@cobol-ts/cursor-loader-cobol 0.0.32 → 0.0.34

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 (3) hide show
  1. package/README.md +16 -12
  2. package/package.json +11 -11
  3. package/README.decoder.md +0 -29
package/README.md CHANGED
@@ -25,7 +25,7 @@ The standard COBOL registry, `createCobolParserRegistry(details)`, also supports
25
25
 
26
26
  ## Quick orientation
27
27
 
28
- **In this README:** [Support matrix (23 October 2026)](#support-matrix-23-october-2026) · [Pipeline: compile once, select lazily](#pipeline-compile-once-select-lazily) · [Nested ODO example: the actual supported path](#nested-odo-example-the-actual-supported-path) · [Pooling, cleanup and allocations](#pooling-cleanup-and-allocations) · [Scalar values and error provenance](#scalar-values-and-error-provenance) · [Relevant tests and next steps](#relevant-tests-and-next-steps) · [COBOL framing: FB, reserved-capacity ODO, and RDW](#cobol-framing-fb-reserved-capacity-odo-and-rdw) · [Optional COBOL diagnostics](#optional-cobol-diagnostics) · [Selecting a fixed-array representation](#selecting-a-fixed-array-representation)
28
+ **In this README:** [Support matrix](#support-matrix) · [Pipeline: compile once, select lazily](#pipeline-compile-once-select-lazily) · [Nested ODO example: the actual supported path](#nested-odo-example-the-actual-supported-path) · [Pooling, cleanup and allocations](#pooling-cleanup-and-allocations) · [Scalar values and error provenance](#scalar-values-and-error-provenance) · [Relevant tests and next steps](#relevant-tests-and-next-steps) · [COBOL framing: FB, reserved-capacity ODO, and RDW](#cobol-framing-fb-reserved-capacity-odo-and-rdw) · [Optional COBOL diagnostics](#optional-cobol-diagnostics) · [Selecting a fixed-array representation](#selecting-a-fixed-array-representation)
29
29
 
30
30
  **Responsibility.** Compile copybook layouts and projections into COBOL fixed-record readers, including REDEFINES and fixed or ODO arrays.
31
31
 
@@ -37,7 +37,7 @@ The standard COBOL registry, `createCobolParserRegistry(details)`, also supports
37
37
 
38
38
  **Related packages.** [@cobol-ts/layout](../layout/README.md) · [@cobol-ts/cursor-projection](../projection/README.md).
39
39
 
40
- ## Support matrix (23 October 2026)
40
+ ## Support matrix
41
41
 
42
42
  | Capability | Current status |
43
43
  | --- | --- |
@@ -48,10 +48,13 @@ The standard COBOL registry, `createCobolParserRegistry(details)`, also supports
48
48
  | Three levels of nested ODO projected arrays | Implemented and tested end to end |
49
49
  | Variable-body occurrence start positions | Lazy, record-owned cached boundary prefixes |
50
50
  | ODO controllers at variable physical positions / one count **per outer occurrence** | **Not supported** by the current controller locator |
51
- | Variable-length physical **record framing** (VB/RDW or other conventions) | Not implemented; `parse()` requires opened-source `recordLengthBytes` |
52
- | Production primitive decoding for projected scalar members | Implemented for the subset documented in `README.decoder.md`; diagnostic projection details remain available for layout tests |
51
+ | Variable-length physical **record framing** | Unblocked RDW supported; VB block descriptors and VBS not supported |
52
+ | Production primitive decoding for projected scalar members | Implemented for the subset documented in [@cobol-ts/codec](../../utils/codec/README.md); diagnostic projection details remain available for layout tests |
53
53
 
54
- **Do not confuse storage layout with record framing.** `compileCobolLayout()` and `createCobolProjectionDetails()` accept symbolic ODO layouts; the `cobolParser.parse()` implementation still requires `details.recordLengthBytes`. For an ODO layout, the caller must arrange a valid framed record length before calling this parser; **the current `parse()` method accepts one `details.recordLengthBytes` for the opened source, not a varying length supplied for each record**. The end-to-end nested geometry tests construct completed `ProjectionPhysicalRecord` fixtures and bind projections directly, rather than testing an automatic ODO record-framing algorithm. `createCobolFixedDetails()` intentionally fails when the record length is not statically known.
54
+ **Do not confuse storage layout with record framing.** ODO determines active
55
+ occurrences; physical record boundaries come from a constant extent, an explicit
56
+ fixed record length or an RDW header. See the framing section below.
57
+ `createCobolFixedDetails()` fails when the compiled record length is not statically known.
55
58
 
56
59
  The layout compiler applies an IBM Enterprise COBOL–oriented subset, not all possible dialect conventions. In particular, its current ODO controller validation requires suitable fixed-location controllers outside repeated occurrences. The symbolic expression algebra and jagged boundary cache are more general than this presently accepted subset.
57
60
 
@@ -173,12 +176,13 @@ Two different sizes must not be confused: `ProjectedArray.length` is the current
173
176
 
174
177
  ## Scalar values and error provenance
175
178
 
176
- The scalar projection functions currently return **debug locations, not decoded COBOL business values**:
177
-
178
- - `string` and `character`: `from/to/hex`, with zero-based record-relative bytes and exclusive end;
179
- - `integer` and `float`: numeric encoding of the debug byte range, **not** an integer or floating-point value read from the COBOL field.
180
-
181
- The separate `@cobol-ts/cobolcodec` package contains production-oriented codec implementations, but these are **not integrated** into the current COBOL projection scalar path.
179
+ Production Node readers use `createCobolDecodedFramedDetails` and
180
+ [@cobol-ts/codec](../../utils/codec/README.md). Decoders are compiled from PICTURE,
181
+ USAGE, sign and field width and operate directly on borrowed fragmented bytes.
182
+ Supported code pages, compiler conventions and decimal precision must be agreed
183
+ before accepting real client data. Diagnostic `createCobolFixedDetails` and
184
+ `createCobolProjectionDetails` retain range values for geometry tests rather than
185
+ returning decoded business values.
182
186
 
183
187
  Projection failures report source filename, record number, offending COBOL field or controller and physical bytes. The generic projection framework builds a full indexed application access path **on error**, e.g. `outers[1].middles[1].inners[1].code`. The path can only include the indices known when the failure occurs; setup failures have no runtime occurrence path.
184
188
 
@@ -193,7 +197,7 @@ Projection failures report source filename, record number, offending COBOL field
193
197
  - `cobol.fixed.array.projection.spec.ts`, `cobol.multiple.nested.arrays.spec.ts`, `cobol.nested.redefines.projection.spec.ts`: fixed arrays, nested arrays and overlays.
194
198
  - `customer.fixtures.spec.ts`, `customer.projections.spec.ts`, `cobol.layout.index.spec.ts`, `cobol.debug.range.spec.ts`: fixtures, compiled name index and range helpers.
195
199
 
196
- Run the package's Jest suite and TypeScript checks in the real workspace; focused lightweight harness checks are not a substitute for the full suite. Remaining work includes occurrence-local ODO controllers, external variable-record framing, integrating scalar codecs, validation with real client files and heap/throughput benchmarks.
200
+ Run the package's Jest suite and TypeScript checks in the real workspace; focused lightweight harness checks are not a substitute for the full suite. Remaining work includes occurrence-local ODO controllers, additional record-framing conventions, validation with real client files and heap/throughput benchmarks.
197
201
 
198
202
  Companion walkthrough: *Byte-Backed COBOL Projections — Nested ODOs, Lazy Positions and Reusable Views* (Google Docs).
199
203
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cobol-ts/cursor-loader-cobol",
3
3
  "description": "Fixed-length COBOL byte-backed parser with compiled occurrence paths and debug projections",
4
- "version": "0.0.32",
4
+ "version": "0.0.34",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index",
7
7
  "browserslist": {
@@ -17,16 +17,16 @@
17
17
  ]
18
18
  },
19
19
  "dependencies": {
20
- "@cobol-ts/cursor-loader-types": "0.0.32",
21
- "@cobol-ts/layout": "0.0.32",
22
- "@cobol-ts/errors": "0.0.32",
23
- "@cobol-ts/copybook": "0.0.32",
24
- "@cobol-ts/size": "0.0.32",
25
- "@cobol-ts/cursor-projection": "0.0.32",
26
- "@cobol-ts/cursor-file": "0.0.32",
27
- "@cobol-ts/arrays": "0.0.32",
28
- "@cobol-ts/codec": "0.0.32",
29
- "@cobol-ts/metrics": "0.0.32"
20
+ "@cobol-ts/cursor-loader-types": "0.0.34",
21
+ "@cobol-ts/layout": "0.0.34",
22
+ "@cobol-ts/errors": "0.0.34",
23
+ "@cobol-ts/copybook": "0.0.34",
24
+ "@cobol-ts/size": "0.0.34",
25
+ "@cobol-ts/cursor-projection": "0.0.34",
26
+ "@cobol-ts/cursor-file": "0.0.34",
27
+ "@cobol-ts/arrays": "0.0.34",
28
+ "@cobol-ts/codec": "0.0.34",
29
+ "@cobol-ts/metrics": "0.0.34"
30
30
  },
31
31
  "devDependencies": {
32
32
  "typescript": "^5.2.2",
package/README.decoder.md DELETED
@@ -1,29 +0,0 @@
1
- # Fixed-record decoded-value integration (23 October 2026)
2
-
3
- The production opt-in details constructors `createCobolDecodedFixedDetails` and
4
- `createCobolDecodedProjectionDetails` use `@cobol-ts/codec`. They preserve
5
- original bytes, compiled geometry, pooled state, nested arrays, ODO count
6
- resolution, and the existing projection lifetime model.
7
-
8
- During selected projection-path compilation, a field's PICTURE, effective
9
- inherited USAGE, sign and compiled field width are used to compile a decoder
10
- exactly once per stable compiled elementary node. On every scalar access the
11
- existing `fieldRange()` finds the current geometry and a *pooled* fragmented
12
- byte cursor decodes the borrowed range. This decoder does not receive a
13
- contiguous copy and works when even individual field bytes are in different
14
- buffers. For now, `createCobolFixedDetails` / `createCobolProjectionDetails`
15
- keep their diagnostic-range values, for compatibility with existing detailed
16
- geometry tests.
17
-
18
- The decoded FB test uses actual original EBCDIC hex fixture bytes,
19
- `createFileCursor()`, a real compiled copybook and 3-byte physical reads. Other
20
- decoded cases exercise COMP signed negative values across buffer boundaries,
21
- fixed OCCURS/REDEFINES and nested three-level ODO with a split scalar field.
22
- A zero-byte phantom record at exact-buffer EOF was also corrected in the
23
- generic record cursor; the new FB test is its regression oracle.
24
-
25
- This is **a first decoded-value milestone, not all possible COBOL encodings**.
26
- Only the documented subset in `@cobol-ts/codec/README.md` has production
27
- decoders. In particular source compiler conventions, code pages and decimal
28
- precision must be agreed before accepting real client data. ODO test fixtures
29
- are bound completed records, not variable-record file-framing integration.