Skip to content

Commit d850767

Browse files
chore: clean up release documentation
1 parent 8cc1efd commit d850767

4 files changed

Lines changed: 21 additions & 30 deletions

File tree

RELEASE.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,11 @@ The generator partitions types into two categories:
5555

5656
Type aliases (`typeAlias`) are now resolved to their underlying Python types at generation time. Where multiple aliases would otherwise produce the same Python type name, unique disambiguating names are generated to avoid conflicts.
5757

58-
Note: `typeAlias` entries that carry a `condition` block have the condition silently discarded — see [RUNE_LANGUAGE_GAPS.md](docs/RUNE_LANGUAGE_GAPS.md) for details. This feature is not currently used in CDM.
58+
Note: Basic type constraints on a `typeAlias` (pattern, min/max length, numeric ranges) are propagated to the generated Python field. However, named `condition` blocks on a `typeAlias` are silently discarded — see [RUNE_LANGUAGE_GAPS.md](docs/RUNE_LANGUAGE_GAPS.md) for details. In CDM, the only `typeAlias` carrying a named condition is `FpMLCodingScheme`, which is used exclusively for FpML codelist domain validation and delegates to the native function `ValidateFpMLCodingSchemeDomain`.
5959

6060
---
6161

62-
### 6. CLI Improvements
63-
64-
Three new flags added to the existing CLI. (Issue [#142](https://github.com/finos/rune-python-generator/issues/142))
65-
66-
| Option | Long form | Description |
67-
| :--- | :--- | :--- |
68-
| `-e` | `--allow-errors` | Continue generating even when validation errors are present |
69-
| `-w` | `--fail-on-warnings` | Treat validation warnings as errors |
70-
| `-n <name>` | `--project-name` | Override the `pyproject.toml` project name (e.g. `finos-cdm`) |
71-
72-
The `--allow-errors` flag is useful when generating from sources that contain unresolvable cross-namespace references. Models with errors are skipped; all valid models are still generated.
73-
74-
---
75-
76-
### 7. Refactored Object, Attribute, and Expression Generation
62+
### 6. Refactored Object, Attribute, and Expression Generation
7763

7864
Internal generator refactoring to simplify code and support reuse:
7965

docs/PR.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ This PR delivers comprehensive function and expression generation support
2626

2727
5. **Completion of support for Type Aliases** — type aliases are resolved with flattened naming conventions and collision handling.
2828

29-
6. **CLI improvements**
30-
- `--project-name` flag enables CDM builds with a custom package prefix (e.g. `finos-cdm`)
31-
- Added flags to control the response to Rune parsing errors (`--allow-errors`) and warnings (`--fail-on-warnings`)
32-
- Execution emits exit codes (`0`/`1`)
33-
34-
7. **Refactored object, attribute, and expression generation** — introduced `PythonExpressionScope` and companion blocks to simplify code and support reuse across the generator.
29+
6. **Refactored object, attribute, and expression generation** — introduced `PythonExpressionScope` and companion blocks to simplify code and support reuse across the generator.
3530

3631
## Test suite
3732

docs/RUNE_LANGUAGE_GAPS.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The following table tracks implementation status for core Rosetta language featu
4343
| Syntax Feature | Needs Generator Support? | Status | CDM Usage | DRR Usage | Implementation Details |
4444
| :--- | :---: | :---: | :---: | :---: | :--- |
4545
| **`typeAlias`** (basic) | **N** | ⚠️ | Extensive | Extensive | The alias is expanded to its underlying base type at generation time (e.g., `typeAlias ISIN: string` → field typed as `str`). The domain name is not preserved in the output. See [ARCHITECTURE.md](ARCHITECTURE.md#6-design-decision-typealias-generation) for the rationale and the planned Rune Path approach. |
46-
| **`typeAlias`** (with `condition`) | **Y** | | Unknown | Unknown | When a `typeAlias` carries a `condition` block, the alias is stripped to its base type and the condition is silently discarded. No validation is generated. See Known Validation and Runtime Gaps below. |
46+
| **`typeAlias`** (with `condition`) | **Y** | ⚠️ | 1 (`FpMLCodingScheme`) | 0 | Basic type constraints (pattern, min/max length, numeric ranges) on a `typeAlias` **are** propagated — the alias is stripped to its underlying base type and `processProperties` extracts those constraints. However, named `condition` blocks are silently discarded. In CDM, the only `typeAlias` with a named condition is `FpMLCodingScheme`, used exclusively for FpML codelist domain validation (calls native `ValidateFpMLCodingSchemeDomain`). See Known Validation and Runtime Gaps below. |
4747
| **`extends`** (Functions) | **Y** || 0 | 0 | Inherits shortcuts, logic, and structure from a base function. Defined in Rune grammar (`func ... extends ...`). Not currently used in CDM or DRR, but must be handled when encountered. |
4848
| **`super`** (Calls) | **Y** || 0 | 0 | Invokes logic from a parent function within the current scope (`RosettaSuperCall` in Rune grammar). Not currently used in CDM or DRR. |
4949

@@ -84,20 +84,28 @@ The following section tracks implementation status and requirements for regulato
8484

8585
The following are known gaps in validation and runtime behaviour that require work in both the generator and the [rune-python-runtime](https://github.com/finos/rune-python-runtime).
8686

87-
### `typeAlias` Conditions on Basic Types
87+
### `typeAlias` Named Condition Blocks
8888

89-
Rune allows conditions to be attached directly to basic type aliases:
89+
Rune allows two kinds of constraints on a `typeAlias`:
90+
91+
1. **Basic type constraints** — pattern, min/max length, numeric ranges — declared on the underlying primitive (e.g., `RStringType`, `RNumberType`). These **are** supported: the generator strips the alias to its base type via `stripFromTypeAliases` and `processProperties` extracts the constraints into the generated Pydantic field.
92+
93+
2. **Named `condition` blocks** — explicit business-logic conditions attached to the alias body:
9094

9195
```rosetta
92-
typeAlias Currency:
96+
typeAlias FpMLCodingScheme(domain string):
9397
string
94-
condition C:
95-
item count = 3
98+
99+
condition IsValidCodingScheme:
100+
if item exists
101+
then ValidateFpMLCodingSchemeDomain(item, domain)
96102
```
97103

98-
The generator expands every `typeAlias` to its underlying base type at generation time (the Java Path — see [ARCHITECTURE.md](ARCHITECTURE.md#6-design-decision-typealias-generation)). Because the alias definition is discarded at the generation step, any `condition` block attached to it is never reached. A field typed as `Currency` is emitted as a plain `str` field with no validation.
104+
Named condition blocks are silently discarded. The alias is stripped to its base type and no validation is generated for the condition.
105+
106+
**CDM usage**: The only `typeAlias` in CDM that carries a named condition is `FpMLCodingScheme`, a parameterized alias used exclusively for FpML codelist domain validation. All leaf aliases (`BusinessCenter`, `FloatingRateIndex`, etc.) are simple instantiations of `FpMLCodingScheme` with a specific domain string and do not carry their own conditions. The condition delegates to the native function `ValidateFpMLCodingSchemeDomain`, so addressing this gap is blocked on native function support as well as the broader Codelist / External Scheme Validation gap described below.
99107

100-
**Impact**: Any `typeAlias` that adds a condition to a primitive type silently skips that validation in generated Python. Addressing this requires either generating a constrained wrapper type (analogous to Pydantic's `Annotated[str, ...]` with a custom validator) or implementing the Rune Path so that the alias and its conditions are preserved in the output.
108+
**Impact**: Any `typeAlias` with a named condition silently skips that validation in the generated Python. Addressing this requires either generating a constrained wrapper type (analogous to Pydantic's `Annotated[str, ...]` with a custom validator) or implementing the Rune Path so that the alias and its conditions are preserved in the output.
101109

102110
### Codelist / External Scheme Validation
103111

python-test/env-setup/setup_python_env.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ function error {
1111
exit 1
1212
}
1313

14+
# todo: pull RuneRuntime from PyPI
15+
1416
# Determine the Python executable
1517
# IMPORTANT: Find a python that is NOT currently inside a virtual environment we might be destroying
1618
if command -v python3 &>/dev/null && ! command -v python3 | grep -q ".pyenv"; then

0 commit comments

Comments
 (0)