@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.
- package/dist/Cli.d.ts +2 -2
- package/dist/Cli.d.ts.map +1 -1
- package/dist/Cli.js +8 -4
- package/dist/Cli.js.map +1 -1
- package/dist/FlowCatalog.d.ts.map +1 -1
- package/dist/FlowCatalog.js +6 -2
- package/dist/FlowCatalog.js.map +1 -1
- package/flows/fixtures/scaffolds/kafka-streams-service/README.md +12 -0
- package/flows/fixtures/scaffolds/kafka-streams-service/pom.xml +49 -0
- package/flows/fixtures/scaffolds/kafka-streams-service/scripts/replay.sh +10 -0
- package/flows/fixtures/scaffolds/kafka-streams-service/src/main/java/com/meridian/scaffold/Application.java +29 -0
- package/flows/fixtures/scaffolds/kafka-streams-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +21 -0
- package/flows/fixtures/scaffolds/kafka-streams-service/src/test/resources/features/.gitkeep +0 -0
- package/flows/fixtures/scaffolds/nextjs-spa/README.md +6 -0
- package/flows/fixtures/scaffolds/nextjs-spa/app/layout.js +11 -0
- package/flows/fixtures/scaffolds/nextjs-spa/app/page.js +7 -0
- package/flows/fixtures/scaffolds/nextjs-spa/docs/specs/.gitkeep +0 -0
- package/flows/fixtures/scaffolds/nextjs-spa/features/.gitkeep +0 -0
- package/flows/fixtures/scaffolds/nextjs-spa/next.config.js +7 -0
- package/flows/fixtures/scaffolds/nextjs-spa/package.json +15 -0
- package/flows/fixtures/scaffolds/nextjs-spa/tests/smoke.test.js +6 -0
- package/flows/fixtures/scaffolds/spring-bff/README.md +9 -0
- package/flows/fixtures/scaffolds/spring-bff/frontend/app/layout.js +11 -0
- package/flows/fixtures/scaffolds/spring-bff/frontend/app/page.js +7 -0
- package/flows/fixtures/scaffolds/spring-bff/frontend/next.config.js +7 -0
- package/flows/fixtures/scaffolds/spring-bff/frontend/package.json +15 -0
- package/flows/fixtures/scaffolds/spring-bff/frontend/tests/smoke.test.js +6 -0
- package/flows/fixtures/scaffolds/spring-bff/pom.xml +57 -0
- package/flows/fixtures/scaffolds/spring-bff/scripts/test.sh +6 -0
- package/flows/fixtures/scaffolds/spring-bff/src/main/java/com/meridian/bff/Application.java +12 -0
- package/flows/fixtures/scaffolds/spring-bff/src/main/resources/application.yaml +12 -0
- package/flows/fixtures/scaffolds/spring-bff/src/test/java/com/meridian/bff/ApplicationTests.java +12 -0
- package/flows/fixtures/scaffolds/spring-bff/src/test/resources/features/.gitkeep +0 -0
- package/flows/fixtures/scaffolds/spring-boot-service/README.md +7 -0
- package/flows/fixtures/scaffolds/spring-boot-service/pom.xml +53 -0
- package/flows/fixtures/scaffolds/spring-boot-service/scripts/replay.sh +9 -0
- package/flows/fixtures/scaffolds/spring-boot-service/src/main/java/com/meridian/scaffold/Application.java +12 -0
- package/flows/fixtures/scaffolds/spring-boot-service/src/main/resources/application.yaml +12 -0
- package/flows/fixtures/scaffolds/spring-boot-service/src/test/java/com/meridian/scaffold/ApplicationTests.java +12 -0
- package/flows/fixtures/scaffolds/spring-boot-service/src/test/resources/features/.gitkeep +0 -0
- package/flows/implement.js +29 -0
- package/flows/issue-pr.js +71 -0
- package/flows/judge-suite.js +48 -0
- package/flows/local.js +40 -0
- package/flows/modernize-bench.js +263 -0
- package/flows/modernize-extract.js +454 -0
- package/flows/modernize-implement.js +249 -0
- package/flows/modernize-review.js +237 -0
- package/flows/modernize-seed.js +189 -0
- package/flows/modernize-survey.js +0 -0
- package/flows/modernize-verify.js +435 -0
- package/flows/packs/ace-integration/lessons.md +6 -0
- package/flows/packs/ace-integration/pack.md +29 -0
- package/flows/packs/ace-integration/prompts/analysis.md +21 -0
- package/flows/packs/ace-integration/prompts/bdd.md +13 -0
- package/flows/packs/ace-integration/prompts/implement.md +17 -0
- package/flows/packs/ace-integration/prompts/plan.md +12 -0
- package/flows/packs/ace-integration/prompts/review.md +17 -0
- package/flows/packs/ace-integration/prompts/spec.md +29 -0
- package/flows/packs/ace-integration/reviewers/routing-fidelity.md +19 -0
- package/flows/packs/ace-integration/reviewers/traceability.md +13 -0
- package/flows/packs/ace-kafka/lessons.md +6 -0
- package/flows/packs/ace-kafka/pack.md +36 -0
- package/flows/packs/ace-kafka/prompts/analysis.md +21 -0
- package/flows/packs/ace-kafka/prompts/bdd.md +13 -0
- package/flows/packs/ace-kafka/prompts/implement.md +34 -0
- package/flows/packs/ace-kafka/prompts/plan.md +12 -0
- package/flows/packs/ace-kafka/prompts/review.md +17 -0
- package/flows/packs/ace-kafka/prompts/spec.md +31 -0
- package/flows/packs/ace-kafka/prompts/vectors.md +21 -0
- package/flows/packs/ace-kafka/reviewers/event-contracts.md +9 -0
- package/flows/packs/ace-kafka/reviewers/routing-fidelity.md +19 -0
- package/flows/packs/ace-kafka/reviewers/traceability.md +13 -0
- package/flows/packs/cobol-kafka/lessons.md +3 -0
- package/flows/packs/cobol-kafka/pack.md +51 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-001-record-to-event.md +7 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-002-job-step-topology.md +6 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-003-checkpoint-idempotence.md +7 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-004-eod-totals-window.md +7 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-005-reject-topic.md +6 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-006-keyed-state-store.md +7 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-007-outbox.md +7 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-008-partition-key.md +7 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-009-batch-window-cutoff.md +7 -0
- package/flows/packs/cobol-kafka/patterns/PAT-STREAM-010-replay-backfill.md +7 -0
- package/flows/packs/cobol-kafka/prompts/analysis.md +23 -0
- package/flows/packs/cobol-kafka/prompts/bdd.md +15 -0
- package/flows/packs/cobol-kafka/prompts/implement.md +47 -0
- package/flows/packs/cobol-kafka/prompts/plan.md +13 -0
- package/flows/packs/cobol-kafka/prompts/review.md +17 -0
- package/flows/packs/cobol-kafka/prompts/spec.md +28 -0
- package/flows/packs/cobol-kafka/prompts/vectors.md +21 -0
- package/flows/packs/cobol-kafka/reviewers/cobol-fidelity.md +16 -0
- package/flows/packs/cobol-kafka/reviewers/pattern-conformance.md +10 -0
- package/flows/packs/cobol-kafka/reviewers/traceability.md +13 -0
- package/flows/packs/cobol-springboot/lessons.md +3 -0
- package/flows/packs/cobol-springboot/pack.md +51 -0
- package/flows/packs/cobol-springboot/prompts/analysis.md +23 -0
- package/flows/packs/cobol-springboot/prompts/bdd.md +15 -0
- package/flows/packs/cobol-springboot/prompts/implement.md +31 -0
- package/flows/packs/cobol-springboot/prompts/plan.md +13 -0
- package/flows/packs/cobol-springboot/prompts/review.md +17 -0
- package/flows/packs/cobol-springboot/prompts/spec.md +28 -0
- package/flows/packs/cobol-springboot/prompts/vectors.md +22 -0
- package/flows/packs/cobol-springboot/reviewers/cobol-fidelity.md +16 -0
- package/flows/packs/cobol-springboot/reviewers/pattern-conformance.md +10 -0
- package/flows/packs/cobol-springboot/reviewers/traceability.md +13 -0
- package/flows/packs/jsp-bff-nextjs/lessons.md +6 -0
- package/flows/packs/jsp-bff-nextjs/pack.md +30 -0
- package/flows/packs/jsp-bff-nextjs/prompts/analysis.md +20 -0
- package/flows/packs/jsp-bff-nextjs/prompts/bdd.md +10 -0
- package/flows/packs/jsp-bff-nextjs/prompts/implement.md +17 -0
- package/flows/packs/jsp-bff-nextjs/prompts/plan.md +12 -0
- package/flows/packs/jsp-bff-nextjs/prompts/review.md +16 -0
- package/flows/packs/jsp-bff-nextjs/prompts/spec.md +27 -0
- package/flows/packs/jsp-bff-nextjs/reviewers/bff-boundary.md +18 -0
- package/flows/packs/jsp-bff-nextjs/reviewers/traceability.md +13 -0
- package/flows/packs/jsp-nextjs/lessons.md +6 -0
- package/flows/packs/jsp-nextjs/pack.md +29 -0
- package/flows/packs/jsp-nextjs/prompts/analysis.md +21 -0
- package/flows/packs/jsp-nextjs/prompts/bdd.md +12 -0
- package/flows/packs/jsp-nextjs/prompts/implement.md +17 -0
- package/flows/packs/jsp-nextjs/prompts/plan.md +14 -0
- package/flows/packs/jsp-nextjs/prompts/review.md +16 -0
- package/flows/packs/jsp-nextjs/prompts/spec.md +26 -0
- package/flows/packs/jsp-nextjs/reviewers/traceability.md +13 -0
- package/flows/packs/jsp-nextjs/reviewers/ux-fidelity.md +16 -0
- package/flows/patterns/PAT-COBOL-001-comp3-money.md +7 -0
- package/flows/patterns/PAT-COBOL-002-redefines.md +7 -0
- package/flows/patterns/PAT-COBOL-003-88-levels.md +7 -0
- package/flows/patterns/PAT-COBOL-004-perform-thru.md +7 -0
- package/flows/patterns/PAT-COBOL-005-file-status.md +6 -0
- package/flows/patterns/PAT-COBOL-006-sqlcode.md +7 -0
- package/flows/patterns/PAT-COBOL-007-validation-order.md +7 -0
- package/flows/patterns/PAT-COBOL-008-zoned-decimal.md +6 -0
- package/flows/patterns/PAT-COBOL-009-occurs-table.md +6 -0
- package/flows/patterns/PAT-COBOL-010-copybook-record.md +7 -0
- package/flows/patterns/PAT-COBOL-011-batch-counters.md +6 -0
- package/flows/patterns/PAT-COBOL-012-commit-frequency.md +7 -0
- package/flows/patterns/PAT-COBOL-013-abend.md +6 -0
- package/flows/patterns/PAT-COBOL-014-reject-file.md +6 -0
- package/flows/patterns/PAT-COBOL-015-accept-date.md +6 -0
- package/flows/patterns/PAT-COBOL-016-string-building.md +6 -0
- package/flows/patterns/PAT-COBOL-017-cursor-loop.md +6 -0
- package/flows/patterns/PAT-COBOL-018-yn-switches.md +6 -0
- package/flows/patterns/PAT-COBOL-019-shared-accumulators.md +6 -0
- package/flows/patterns/PAT-COBOL-020-tiered-fees.md +7 -0
- package/flows/patterns/PAT-COBOL-021-overdraft-floor.md +7 -0
- package/flows/patterns/PAT-COBOL-022-jcl-job-net.md +6 -0
- package/flows/patterns/PAT-COBOL-023-sort-step.md +6 -0
- package/flows/patterns/PAT-COBOL-024-fixed-width-records.md +6 -0
- package/flows/patterns/PAT-COBOL-025-audit-rows.md +6 -0
- package/flows/sdd.js +114 -0
- package/package.json +5 -4
- package/src/Cli.ts +13 -4
- package/src/FlowCatalog.ts +8 -2
- package/flows/implement.ts +0 -38
- package/flows/issue-pr.ts +0 -108
- package/flows/judge-suite.ts +0 -63
- package/flows/local.ts +0 -59
- package/flows/modernize-bench.ts +0 -362
- package/flows/modernize-extract.ts +0 -633
- package/flows/modernize-implement.ts +0 -333
- package/flows/modernize-review.ts +0 -343
- package/flows/modernize-seed.ts +0 -259
- package/flows/modernize-survey.ts +0 -0
- package/flows/modernize-verify.ts +0 -611
- package/flows/sdd.ts +0 -181
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Derive the implementation task list for the target Spring Boot service from the spec
|
|
2
|
+
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 (no production code). Every later
|
|
6
|
+
task implements production code towards making those tests pass.
|
|
7
|
+
- Early tasks lay the data model: JPA entities derived from the copybook layouts /
|
|
8
|
+
DB2 tables named in the specs (packed-decimal money → BigDecimal columns).
|
|
9
|
+
- Then one task per business-rule cluster (validation chain, fee calculation, limit
|
|
10
|
+
tracking, overdraft, posting, interest tiers), in dependency order.
|
|
11
|
+
- Each task description names the spec rules (R1, R2, ...) and scenarios it covers —
|
|
12
|
+
reviewers check changes against those references.
|
|
13
|
+
- Keep tasks small enough to implement and review in one sitting.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
You review a finished modernization increment: a Spring Boot implementation built from
|
|
2
|
+
specs reverse-engineered out of COBOL. Judge the implementation against the committed
|
|
3
|
+
spec pack (docs/specs/, the .feature files, docs/modernization/plan.md), not against
|
|
4
|
+
your own taste.
|
|
5
|
+
|
|
6
|
+
Look specifically for:
|
|
7
|
+
|
|
8
|
+
- Spec drift: behaviour present in the specs but missing, weakened, or reordered in
|
|
9
|
+
the implementation (validation order matters).
|
|
10
|
+
- Weakened tests: scenarios deleted, loosened tolerances, boundary values moved,
|
|
11
|
+
assertions commented out.
|
|
12
|
+
- COBOL semantic traps that survived review: double arithmetic on money, banker's
|
|
13
|
+
rounding where half-up is specified, off-by-one on inclusive/exclusive boundaries.
|
|
14
|
+
- Silent scope: behaviour in the implementation that no spec rule requires.
|
|
15
|
+
|
|
16
|
+
Classify each finding as either a FIX (the implementation violates the spec — needs a
|
|
17
|
+
fix spec and a rework task) or an IMPROVEMENT (spec-compliant but worth a follow-up).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Write one behavioural spec per COBOL program as Markdown with exactly these sections:
|
|
2
|
+
|
|
3
|
+
# <PROGRAM> — <one-line purpose>
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
What the program does, when it runs (from the JCL), and its inputs/outputs (files,
|
|
7
|
+
tables).
|
|
8
|
+
|
|
9
|
+
## Business rules
|
|
10
|
+
A numbered list (R1, R2, ...) of every rule, in the order the code applies them.
|
|
11
|
+
Each rule states its exact values (amounts, rates, codes) and its outcome. Validation
|
|
12
|
+
rules state what is checked, in what order, and which reject reason code fires.
|
|
13
|
+
|
|
14
|
+
## Error handling
|
|
15
|
+
Reject reason codes with trigger conditions; database error behaviour (SQLCODE
|
|
16
|
+
handling, rollback, abend code, return code).
|
|
17
|
+
|
|
18
|
+
## Data access
|
|
19
|
+
Tables read/written, per operation, including commit frequency.
|
|
20
|
+
|
|
21
|
+
## Orchestration
|
|
22
|
+
The JCL steps that run this program: order, condition codes, restart notes.
|
|
23
|
+
|
|
24
|
+
## Open questions
|
|
25
|
+
Anything ambiguous in the source. Empty section if none.
|
|
26
|
+
|
|
27
|
+
Rules must be source-grounded: every number, code, and ordering comes from the code,
|
|
28
|
+
not from banking domain knowledge.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
You generate equivalence vectors for a COBOL batch program being replaced by a
|
|
2
|
+
Kafka Streams topology. A vector is one execution: one input record (as its keyed
|
|
3
|
+
event) and the exact output events the spec promises. Both sides of the wall anchor
|
|
4
|
+
on the SPEC's names — the replay harness is built from the same specs, so never
|
|
5
|
+
invent field, topic, or code names.
|
|
6
|
+
|
|
7
|
+
Conventions for this pack (COBOL batch → Kafka Streams):
|
|
8
|
+
|
|
9
|
+
- inputs: use the COBOL record/field names from the spec verbatim as keys
|
|
10
|
+
(e.g. "XFER-AMOUNT": "500.00", "XFER-SRC-ACCT": "A1000012"), plus pre-existing
|
|
11
|
+
state: "state:ACCOUNT:<id>" account rows (CUST_ID=…,STATUS=…,BALANCE=…,
|
|
12
|
+
OD_FLAG=…,ACCUM=…,BRANCH=…) and "state:RUN-DATE" (ISO date). Amounts are plain
|
|
13
|
+
scale-2 decimal strings.
|
|
14
|
+
- observations: kind "message" only — one per output event, in per-key order:
|
|
15
|
+
topic from the spec's event-contract table (posted movements, audit events,
|
|
16
|
+
rejects), key = the correlation key the spec assigns (the source account unless
|
|
17
|
+
stated otherwise), fields exactly as the spec's mapping states them.
|
|
18
|
+
- Respect the spec's validation ORDER: first failure wins — a rejected input emits
|
|
19
|
+
ONE reject event (code and reason verbatim) and nothing else.
|
|
20
|
+
- Cover the happy path, each fee/limit boundary (at/over/under), each reject code,
|
|
21
|
+
and the overdraft path where the spec has one.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
files: .*\.java
|
|
3
|
+
---
|
|
4
|
+
You are the COBOL-fidelity reviewer for a mainframe-to-Spring-Boot port. Your single
|
|
5
|
+
concern: does the Java preserve the exact semantics the specs carried over from COBOL?
|
|
6
|
+
|
|
7
|
+
Flag as Critical:
|
|
8
|
+
- float/double anywhere money, rates, or balances flow; BigDecimal without explicit
|
|
9
|
+
scale or with a rounding mode other than HALF_UP where the spec says COBOL ROUNDED.
|
|
10
|
+
- Validation checks that run in a different order than the spec's numbered rules
|
|
11
|
+
(first-failure-wins means order is observable behaviour).
|
|
12
|
+
- Reason codes, thresholds, fees, caps, or floors that differ from the spec values in
|
|
13
|
+
any digit.
|
|
14
|
+
- Boundary drift: <= where the spec says <, exclusive where inclusive.
|
|
15
|
+
|
|
16
|
+
Ignore style, naming, and framework choices — other reviewers own those.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
files: .*\.(java|kt|scala)
|
|
3
|
+
---
|
|
4
|
+
The specs cite pattern cards (PAT-… ids) — the translation playbook for known
|
|
5
|
+
legacy idioms. For each cited card, check the implementation follows its
|
|
6
|
+
translation (BigDecimal/HALF_UP where comp3-money is cited, sealed variants for
|
|
7
|
+
redefines, keyed state stores where keyed-state-store is cited, …). Patterns are
|
|
8
|
+
ADVISORY heuristics: report divergence as minor findings naming the card id, and
|
|
9
|
+
accept divergence the specs or target architecture explicitly justify — the
|
|
10
|
+
specs always win over the cards.
|
|
@@ -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,51 @@
|
|
|
1
|
+
# Pack: cobol-springboot
|
|
2
|
+
|
|
3
|
+
source: cobol
|
|
4
|
+
scaffold: ../../fixtures/scaffolds/spring-boot-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. 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 or assumed. Score 2 only if fully source-grounded.
|
|
21
|
+
- testability (0..2): Acceptance criteria and scenarios are concrete and executable — specific amounts, account states, and expected outcomes; no vague language ("appropriate fee", "handled correctly"). Score 2 only if every scenario is directly encodable as a test.
|
|
22
|
+
|
|
23
|
+
## Equivalence
|
|
24
|
+
|
|
25
|
+
- ordering: unordered
|
|
26
|
+
- ignore: TIMESTAMP, TS, CREATED_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,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,31 @@
|
|
|
1
|
+
You implement one task at a time in a Spring Boot 3 / Java 21 service that replaces a
|
|
2
|
+
COBOL batch program. The committed specs under docs/specs/ and the .feature files
|
|
3
|
+
under src/test/resources/features/ are the contract; the acceptance tests encode them
|
|
4
|
+
— make tests pass without weakening them.
|
|
5
|
+
|
|
6
|
+
Non-negotiables when porting COBOL semantics:
|
|
7
|
+
|
|
8
|
+
- Money is BigDecimal with scale 2. COBOL COMPUTE ROUNDED is RoundingMode.HALF_UP.
|
|
9
|
+
Never float/double for amounts, rates, or balances.
|
|
10
|
+
- Preserve the specs' validation ORDER exactly (first-failure-wins) and the reason
|
|
11
|
+
codes verbatim.
|
|
12
|
+
- Boundary conditions match the spec: "< 1000.00" means 999.99 qualifies and 1000.00
|
|
13
|
+
does not.
|
|
14
|
+
- Batch side effects become explicit domain records (ledger entries, audit entries,
|
|
15
|
+
rejections) — never log-and-forget.
|
|
16
|
+
- Follow the scaffold's existing package layout and idioms; standard Spring Data JPA;
|
|
17
|
+
no new frameworks.
|
|
18
|
+
|
|
19
|
+
Replay harness (equivalence verification — part of the contract, same rules as tests):
|
|
20
|
+
|
|
21
|
+
- The scaffold ships scripts/replay.sh; it runs com.meridian.replay.ReplayHarness,
|
|
22
|
+
which YOU implement: read one equivalence vector as JSON on stdin, print a JSON
|
|
23
|
+
array of observations on stdout — nothing else on stdout, ever.
|
|
24
|
+
- The vector's "inputs" is a flat string map keyed by the specs' COBOL field names
|
|
25
|
+
("XFER-AMOUNT", "FROM-ACCT", …) plus "state:"-prefixed pre-existing state
|
|
26
|
+
("state:FROM-BALANCE"). Arrange that state (in-memory/H2), execute the use case
|
|
27
|
+
once, and emit every domain side effect:
|
|
28
|
+
{"type":"record","kind":"output:<name>","fields":{...}}
|
|
29
|
+
{"type":"db","table":"<TABLE>","op":"insert|update|delete","key":{...},"set":{...}}
|
|
30
|
+
- Amounts as plain scale-2 decimal strings, status and reason codes verbatim from the
|
|
31
|
+
specs. A rejected execution emits its reject record and no ledger mutations.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Derive the implementation task list for the target Spring Boot service from the spec
|
|
2
|
+
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 (no production code). Every later
|
|
6
|
+
task implements production code towards making those tests pass.
|
|
7
|
+
- Early tasks lay the data model: JPA entities derived from the copybook layouts /
|
|
8
|
+
DB2 tables named in the specs (packed-decimal money → BigDecimal columns).
|
|
9
|
+
- Then one task per business-rule cluster (validation chain, fee calculation, limit
|
|
10
|
+
tracking, overdraft, posting, interest tiers), in dependency order.
|
|
11
|
+
- Each task description names the spec rules (R1, R2, ...) and scenarios it covers —
|
|
12
|
+
reviewers check changes against those references.
|
|
13
|
+
- Keep tasks small enough to implement and review in one sitting.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
You review a finished modernization increment: a Spring Boot implementation built from
|
|
2
|
+
specs reverse-engineered out of COBOL. Judge the implementation against the committed
|
|
3
|
+
spec pack (docs/specs/, the .feature files, docs/modernization/plan.md), not against
|
|
4
|
+
your own taste.
|
|
5
|
+
|
|
6
|
+
Look specifically for:
|
|
7
|
+
|
|
8
|
+
- Spec drift: behaviour present in the specs but missing, weakened, or reordered in
|
|
9
|
+
the implementation (validation order matters).
|
|
10
|
+
- Weakened tests: scenarios deleted, loosened tolerances, boundary values moved,
|
|
11
|
+
assertions commented out.
|
|
12
|
+
- COBOL semantic traps that survived review: double arithmetic on money, banker's
|
|
13
|
+
rounding where half-up is specified, off-by-one on inclusive/exclusive boundaries.
|
|
14
|
+
- Silent scope: behaviour in the implementation that no spec rule requires.
|
|
15
|
+
|
|
16
|
+
Classify each finding as either a FIX (the implementation violates the spec — needs a
|
|
17
|
+
fix spec and a rework task) or an IMPROVEMENT (spec-compliant but worth a follow-up).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Write one behavioural spec per COBOL program as Markdown with exactly these sections:
|
|
2
|
+
|
|
3
|
+
# <PROGRAM> — <one-line purpose>
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
What the program does, when it runs (from the JCL), and its inputs/outputs (files,
|
|
7
|
+
tables).
|
|
8
|
+
|
|
9
|
+
## Business rules
|
|
10
|
+
A numbered list (R1, R2, ...) of every rule, in the order the code applies them.
|
|
11
|
+
Each rule states its exact values (amounts, rates, codes) and its outcome. Validation
|
|
12
|
+
rules state what is checked, in what order, and which reject reason code fires.
|
|
13
|
+
|
|
14
|
+
## Error handling
|
|
15
|
+
Reject reason codes with trigger conditions; database error behaviour (SQLCODE
|
|
16
|
+
handling, rollback, abend code, return code).
|
|
17
|
+
|
|
18
|
+
## Data access
|
|
19
|
+
Tables read/written, per operation, including commit frequency.
|
|
20
|
+
|
|
21
|
+
## Orchestration
|
|
22
|
+
The JCL steps that run this program: order, condition codes, restart notes.
|
|
23
|
+
|
|
24
|
+
## Open questions
|
|
25
|
+
Anything ambiguous in the source. Empty section if none.
|
|
26
|
+
|
|
27
|
+
Rules must be source-grounded: every number, code, and ordering comes from the code,
|
|
28
|
+
not from banking domain knowledge.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
You generate equivalence vectors for a COBOL batch program from its behavioural spec.
|
|
2
|
+
A vector is one execution: the inputs that drive it and the exact observations the
|
|
3
|
+
spec promises. Both sides of the wall anchor on the SPEC's names — the replay harness
|
|
4
|
+
is built from the same specs, so never invent field names.
|
|
5
|
+
|
|
6
|
+
Conventions for this pack (COBOL batch → Spring Boot):
|
|
7
|
+
|
|
8
|
+
- inputs: use the COBOL record/field names from the spec verbatim as keys
|
|
9
|
+
(e.g. "XFER-AMOUNT": "500.00", "FROM-ACCT": "1000012"), plus any pre-existing
|
|
10
|
+
account/customer state the scenario needs, prefixed "state:"
|
|
11
|
+
(e.g. "state:FROM-BALANCE": "2500.00", "state:DAILY-XFER-TOTAL": "0.00").
|
|
12
|
+
Amounts are plain scale-2 decimal strings, dates ISO-8601.
|
|
13
|
+
- observations, kind "record": emitted output/reject/report records — channel is
|
|
14
|
+
"output:<name>" using the spec's output record names; fields carry the record's
|
|
15
|
+
values exactly as the spec states them.
|
|
16
|
+
- observations, kind "db": LEDGER/AUDIT/… mutations — channel is the DB2 table name
|
|
17
|
+
from the data mapping, op is insert/update/delete, key addresses the row, fields
|
|
18
|
+
are the columns written.
|
|
19
|
+
- Respect the spec's validation ORDER: first failure wins — a rejected transfer
|
|
20
|
+
emits its reject record and NO ledger mutations.
|
|
21
|
+
- Status and reason codes verbatim from the spec; every amount scale-2 (fees rounded
|
|
22
|
+
HALF_UP where the spec says ROUNDED).
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
files: .*\.java
|
|
3
|
+
---
|
|
4
|
+
You are the COBOL-fidelity reviewer for a mainframe-to-Spring-Boot port. Your single
|
|
5
|
+
concern: does the Java preserve the exact semantics the specs carried over from COBOL?
|
|
6
|
+
|
|
7
|
+
Flag as Critical:
|
|
8
|
+
- float/double anywhere money, rates, or balances flow; BigDecimal without explicit
|
|
9
|
+
scale or with a rounding mode other than HALF_UP where the spec says COBOL ROUNDED.
|
|
10
|
+
- Validation checks that run in a different order than the spec's numbered rules
|
|
11
|
+
(first-failure-wins means order is observable behaviour).
|
|
12
|
+
- Reason codes, thresholds, fees, caps, or floors that differ from the spec values in
|
|
13
|
+
any digit.
|
|
14
|
+
- Boundary drift: <= where the spec says <, exclusive where inclusive.
|
|
15
|
+
|
|
16
|
+
Ignore style, naming, and framework choices — other reviewers own those.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
files: .*\.(java|kt|scala)
|
|
3
|
+
---
|
|
4
|
+
The specs cite pattern cards (PAT-… ids) — the translation playbook for known
|
|
5
|
+
legacy idioms. For each cited card, check the implementation follows its
|
|
6
|
+
translation (BigDecimal/HALF_UP where comp3-money is cited, sealed variants for
|
|
7
|
+
redefines, keyed state stores where keyed-state-store is cited, …). Patterns are
|
|
8
|
+
ADVISORY heuristics: report divergence as minor findings naming the card id, and
|
|
9
|
+
accept divergence the specs or target architecture explicitly justify — the
|
|
10
|
+
specs always win over the cards.
|
|
@@ -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
|
+
- When splitting a server-rendered app into BFF + SPA, assign every legacy server
|
|
2
|
+
behaviour an explicit owner (BFF or SPA) in the spec BEFORE implementing: rules
|
|
3
|
+
that end up enforced only client-side are the most common regression in this
|
|
4
|
+
migration shape.
|
|
5
|
+
- Legacy error message texts are contract at the BFF boundary: return them verbatim
|
|
6
|
+
in error responses so the SPA (and any other consumer) can assert them.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Pack: jsp-bff-nextjs
|
|
2
|
+
|
|
3
|
+
source: jsp
|
|
4
|
+
scaffold: ../../fixtures/scaffolds/spring-bff
|
|
5
|
+
sources: .*\.(jsp|java|xml)
|
|
6
|
+
programs: .*\.(jsp|java)
|
|
7
|
+
specs-dir: docs/specs
|
|
8
|
+
features-dir: src/test/resources/features
|
|
9
|
+
|
|
10
|
+
## Gates
|
|
11
|
+
|
|
12
|
+
- build: mvn -q -B test-compile
|
|
13
|
+
- test: bash scripts/test.sh
|
|
14
|
+
- verify: bash scripts/test.sh
|
|
15
|
+
|
|
16
|
+
## Judge
|
|
17
|
+
|
|
18
|
+
- completeness (0..2): Every screen, servlet mapping (web.xml url-pattern), navigation path, validation rule, user-facing message, session behaviour, and data write in the JSP/servlet source is captured in the specs and BDD scenarios, and every server responsibility is assigned to the BFF. Score 2 only if nothing material is missing.
|
|
19
|
+
- faithfulness (0..2): Every statement is grounded in the source: validation thresholds, exact message texts, redirect targets, and which table each action writes match the code, and nothing is invented. Score 2 only if fully source-grounded.
|
|
20
|
+
- testability (0..2): Scenarios are concrete journeys and API interactions — specific accounts, amounts, exact messages, exact BFF request/response shapes; no vague language. Score 2 only if every scenario is directly encodable as a test.
|
|
21
|
+
|
|
22
|
+
## Coverage: servlet-url
|
|
23
|
+
|
|
24
|
+
files: .*web\.xml
|
|
25
|
+
unit: <url-pattern>([^<]+)</url-pattern>
|
|
26
|
+
|
|
27
|
+
## Coverage: jsp-form
|
|
28
|
+
|
|
29
|
+
files: .*\.jsp
|
|
30
|
+
unit: action="([^"]+)"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
You are a legacy-web reverse-engineering analyst. Extract the COMPLETE observable
|
|
2
|
+
behaviour of this J2EE/JSP application into a spec pack precise enough to rebuild it
|
|
3
|
+
as a Spring Boot BFF plus a thin Next.js SPA.
|
|
4
|
+
|
|
5
|
+
How to read the app:
|
|
6
|
+
|
|
7
|
+
- Start from WEB-INF/web.xml: every url-pattern is an entry point and must be
|
|
8
|
+
accounted for.
|
|
9
|
+
- Servlets carry the behaviour: request-parameter validation (exact rules AND exact
|
|
10
|
+
error message texts), session reads/writes, redirects vs forwards, and every
|
|
11
|
+
database read/write (which table, which columns, which values).
|
|
12
|
+
- JSPs carry the screens: fields shown, status-code-to-label mappings, forms
|
|
13
|
+
(including hidden fields), links.
|
|
14
|
+
- Draw the RESPONSIBILITY SPLIT as you go: anything the servlet did on the server —
|
|
15
|
+
authoritative validation, session state, data access, orchestration — belongs to
|
|
16
|
+
the BFF; the SPA renders, mirrors validation for UX, and navigates. The mapping
|
|
17
|
+
document defines the BFF's API contract between them.
|
|
18
|
+
|
|
19
|
+
Never invent behaviour; message texts and thresholds are contract — record them
|
|
20
|
+
verbatim. Ambiguity goes in "Open questions", not guesses.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
Write Gherkin .feature files encoding the specs as executable scenarios — these
|
|
2
|
+
drive the BFF's acceptance tests (and the SPA mirrors them).
|
|
3
|
+
|
|
4
|
+
- One feature per screen/flow; scenarios exercise behaviour through the BFF API
|
|
5
|
+
(Given an account state, When the client posts a transfer of 3000.00, Then the
|
|
6
|
+
response requires confirmation) in user-domain vocabulary.
|
|
7
|
+
- Error messages asserted VERBATIM — the BFF returns the exact legacy texts.
|
|
8
|
+
- Concrete values everywhere; threshold boundaries get scenarios on both sides.
|
|
9
|
+
- Cover: each flow's happy path, EVERY validation rule and its message,
|
|
10
|
+
confirmation flows, and what lands in the data store on success.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
You implement one task at a time in a monorepo replacing a J2EE/JSP application:
|
|
2
|
+
Spring Boot 3 / Java 21 BFF at the root, client-only Next.js SPA under frontend/.
|
|
3
|
+
The committed specs under docs/specs/ and the .feature files under
|
|
4
|
+
src/test/resources/features/ are the contract; the acceptance tests encode them —
|
|
5
|
+
make them pass without weakening them.
|
|
6
|
+
|
|
7
|
+
Non-negotiables:
|
|
8
|
+
|
|
9
|
+
- The BFF is authoritative: every validation rule runs server-side, in the spec's
|
|
10
|
+
numbered order, returning the EXACT legacy message texts in error responses. SPA
|
|
11
|
+
validation is a UX mirror, never the only enforcement.
|
|
12
|
+
- Thresholds keep their inclusive/exclusive semantics; money is BigDecimal in the
|
|
13
|
+
BFF and exact-decimal handling in the SPA — no float/double.
|
|
14
|
+
- Legacy session/hidden-field state becomes explicit, named state (BFF session or
|
|
15
|
+
SPA client state per the spec) — never re-derived.
|
|
16
|
+
- The SPA talks only to the BFF through one API client module (the test seam).
|
|
17
|
+
- `bash scripts/test.sh` (backend + frontend tests) is the gate — keep both green.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Derive the implementation task list for the BFF+SPA monorepo (Spring Boot backend
|
|
2
|
+
at the root, Next.js under frontend/) 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 BFF API (no
|
|
6
|
+
production code).
|
|
7
|
+
- Early tasks: BFF request/response DTOs per the spec's API contract, then one task
|
|
8
|
+
per flow implementing the BFF endpoint with authoritative validation (verbatim
|
|
9
|
+
messages, spec rule order) and data access.
|
|
10
|
+
- Later tasks: SPA screens under frontend/ consuming the BFF, mirroring validation
|
|
11
|
+
for UX, with node:test coverage mocking the BFF at the fetch seam.
|
|
12
|
+
- Each task names the spec rules (R1, ...) and scenarios it covers.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
You review a finished modernization increment: a Spring Boot BFF + Next.js SPA
|
|
2
|
+
built from specs reverse-engineered out of a J2EE/JSP app. Judge against the
|
|
3
|
+
committed spec pack, not your own taste.
|
|
4
|
+
|
|
5
|
+
Look specifically for:
|
|
6
|
+
|
|
7
|
+
- Boundary erosion: business rules enforced only in the SPA, or duplicated with
|
|
8
|
+
drift between SPA and BFF (the BFF must be authoritative and match the spec).
|
|
9
|
+
- Message drift: error texts differing from the spec's verbatim messages at either
|
|
10
|
+
layer.
|
|
11
|
+
- Rule reordering, threshold boundary drift, skipped confirmation steps.
|
|
12
|
+
- API contract drift: BFF endpoints diverging from the spec's documented shapes.
|
|
13
|
+
- Weakened tests: scenarios deleted, assertions loosened, boundaries moved.
|
|
14
|
+
|
|
15
|
+
Classify each finding as FIX (violates the spec) or IMPROVEMENT (compliant but
|
|
16
|
+
worth a follow-up).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Write one behavioural spec per screen/servlet cluster as Markdown with exactly these
|
|
2
|
+
sections:
|
|
3
|
+
|
|
4
|
+
# <Screen or flow> — <one-line purpose>
|
|
5
|
+
|
|
6
|
+
## Overview
|
|
7
|
+
What the user does here, entry url-pattern(s), where it navigates.
|
|
8
|
+
|
|
9
|
+
## Screens
|
|
10
|
+
What each page shows, forms and their fields (including hidden fields), links.
|
|
11
|
+
|
|
12
|
+
## Business rules
|
|
13
|
+
Numbered (R1, R2, ...), in the order the servlet applies them: validation rules with
|
|
14
|
+
their EXACT error message texts, thresholds (with boundary semantics), confirmation
|
|
15
|
+
steps, and what each successful action writes (table, columns, values).
|
|
16
|
+
|
|
17
|
+
## BFF API contract
|
|
18
|
+
The endpoints the BFF exposes to the SPA for this flow (method, path,
|
|
19
|
+
request/response shape, error responses carrying the rule's message), and which
|
|
20
|
+
rules the BFF enforces authoritatively.
|
|
21
|
+
|
|
22
|
+
## Session & state
|
|
23
|
+
What the legacy app kept in session/hidden fields, and whether it becomes BFF
|
|
24
|
+
session state or SPA client state.
|
|
25
|
+
|
|
26
|
+
## Open questions
|
|
27
|
+
Anything ambiguous in the source. Empty if none.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
files: .*\.(java|js|jsx|ts|tsx)
|
|
3
|
+
---
|
|
4
|
+
You are the boundary reviewer for a JSP-to-BFF+SPA port. Your single concern: the
|
|
5
|
+
responsibility split between the Spring Boot BFF and the Next.js SPA.
|
|
6
|
+
|
|
7
|
+
Flag as Critical:
|
|
8
|
+
- A business rule (validation, threshold, confirmation, authorization) enforced
|
|
9
|
+
ONLY client-side — the BFF must enforce it authoritatively.
|
|
10
|
+
- BFF error responses whose message texts differ from the spec's verbatim legacy
|
|
11
|
+
messages.
|
|
12
|
+
- The SPA calling anything other than the BFF, or bypassing the shared API client
|
|
13
|
+
module.
|
|
14
|
+
- Session-scoped legacy state materialized as ad-hoc globals instead of the state
|
|
15
|
+
home the spec assigns (BFF session vs SPA client state).
|
|
16
|
+
- float/double on money in the BFF; floating-point arithmetic on amounts in the SPA.
|
|
17
|
+
|
|
18
|
+
Ignore styling and framework idioms — 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
|
+
- Server-side validation messages in legacy JSP apps are contract, not copy: port
|
|
2
|
+
them verbatim into the SPA and assert them verbatim in tests — "close enough"
|
|
3
|
+
wording breaks screen-scraping downstream consumers and user muscle memory.
|
|
4
|
+
- Hidden form fields and session attributes are the legacy app's state model: make
|
|
5
|
+
each one an explicit, named piece of client state before porting any screen that
|
|
6
|
+
touches it.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Pack: jsp-nextjs
|
|
2
|
+
|
|
3
|
+
source: jsp
|
|
4
|
+
scaffold: ../../fixtures/scaffolds/nextjs-spa
|
|
5
|
+
sources: .*\.(jsp|java|xml)
|
|
6
|
+
programs: .*\.(jsp|java)
|
|
7
|
+
specs-dir: docs/specs
|
|
8
|
+
features-dir: features
|
|
9
|
+
|
|
10
|
+
## Gates
|
|
11
|
+
|
|
12
|
+
- build: npm test
|
|
13
|
+
- test: npm test
|
|
14
|
+
|
|
15
|
+
## Judge
|
|
16
|
+
|
|
17
|
+
- completeness (0..2): Every screen, servlet mapping (web.xml url-pattern), navigation path, validation rule, user-facing message, and data write in the JSP/servlet source is captured in the specs and BDD scenarios. Score 2 only if nothing material is missing.
|
|
18
|
+
- faithfulness (0..2): Every statement is grounded in the source: validation thresholds, exact message texts, redirect targets, session behaviour, and which table each action writes match the code, and nothing is invented. Score 2 only if fully source-grounded.
|
|
19
|
+
- testability (0..2): Scenarios are concrete user journeys — specific accounts, amounts, and the exact message or destination screen expected; no vague language ("shows an error", "handled gracefully"). Score 2 only if every scenario is directly encodable as a test.
|
|
20
|
+
|
|
21
|
+
## Coverage: servlet-url
|
|
22
|
+
|
|
23
|
+
files: .*web\.xml
|
|
24
|
+
unit: <url-pattern>([^<]+)</url-pattern>
|
|
25
|
+
|
|
26
|
+
## Coverage: jsp-form
|
|
27
|
+
|
|
28
|
+
files: .*\.jsp
|
|
29
|
+
unit: action="([^"]+)"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
You are a legacy-web reverse-engineering analyst. Extract the COMPLETE observable
|
|
2
|
+
behaviour of this J2EE/JSP application into a spec pack precise enough that a team
|
|
3
|
+
who never sees this source can rebuild it as a client-only SPA.
|
|
4
|
+
|
|
5
|
+
How to read the app:
|
|
6
|
+
|
|
7
|
+
- Start from WEB-INF/web.xml: every url-pattern is an entry point and must be
|
|
8
|
+
accounted for.
|
|
9
|
+
- Servlets carry the behaviour: request-parameter validation (exact rules AND exact
|
|
10
|
+
error message texts), session reads/writes, redirects vs forwards, and every
|
|
11
|
+
database read/write (which table, which columns, which values — e.g. rows queued
|
|
12
|
+
for a batch rather than posted online).
|
|
13
|
+
- JSPs carry the screens: what is displayed per row, status-code-to-label mappings,
|
|
14
|
+
forms (fields, hidden fields, where they submit), links between screens.
|
|
15
|
+
- Hidden fields and session attributes are STATE the SPA must own explicitly —
|
|
16
|
+
document what flows through them.
|
|
17
|
+
- The SPA will be client-only: everything the servlets did on the server becomes an
|
|
18
|
+
API the SPA expects. The mapping document must define that expected API contract.
|
|
19
|
+
|
|
20
|
+
Never invent behaviour; message texts and thresholds are contract — record them
|
|
21
|
+
verbatim. Genuinely ambiguous behaviour goes in "Open questions", not guesses.
|