dtcs 0.1.0__tar.gz

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 (100) hide show
  1. dtcs-0.1.0/.editorconfig +18 -0
  2. dtcs-0.1.0/.github/workflows/checks.yml +47 -0
  3. dtcs-0.1.0/.github/workflows/ci.yml +9 -0
  4. dtcs-0.1.0/.github/workflows/release.yml +44 -0
  5. dtcs-0.1.0/.gitignore +28 -0
  6. dtcs-0.1.0/CONTRIBUTING.md +50 -0
  7. dtcs-0.1.0/Cargo.lock +647 -0
  8. dtcs-0.1.0/Cargo.toml +49 -0
  9. dtcs-0.1.0/LICENSE +17 -0
  10. dtcs-0.1.0/PKG-INFO +125 -0
  11. dtcs-0.1.0/README.md +100 -0
  12. dtcs-0.1.0/SPEC.md +4893 -0
  13. dtcs-0.1.0/docs/README.md +39 -0
  14. dtcs-0.1.0/docs/editorial/authoring-guide.md +225 -0
  15. dtcs-0.1.0/docs/editorial/baseline.md +144 -0
  16. dtcs-0.1.0/docs/editorial/review-checklist.md +130 -0
  17. dtcs-0.1.0/docs/editorial/style-guide.md +153 -0
  18. dtcs-0.1.0/docs/implementation/README.md +26 -0
  19. dtcs-0.1.0/docs/implementation/architecture.md +41 -0
  20. dtcs-0.1.0/docs/implementation/cli-spec.md +25 -0
  21. dtcs-0.1.0/docs/implementation/crate-layout.md +66 -0
  22. dtcs-0.1.0/docs/implementation/diagnostics-guide.md +70 -0
  23. dtcs-0.1.0/docs/implementation/implementation-phases.md +61 -0
  24. dtcs-0.1.0/docs/implementation/model-guide.md +41 -0
  25. dtcs-0.1.0/docs/implementation/non-goals.md +27 -0
  26. dtcs-0.1.0/docs/implementation/project-goal.md +21 -0
  27. dtcs-0.1.0/docs/implementation/public-api.md +59 -0
  28. dtcs-0.1.0/docs/implementation/rust-dependencies.md +36 -0
  29. dtcs-0.1.0/docs/implementation/spec-usage.md +15 -0
  30. dtcs-0.1.0/docs/implementation/testing-plan.md +19 -0
  31. dtcs-0.1.0/docs/implementation/validation-guide.md +25 -0
  32. dtcs-0.1.0/examples/customer_normalize.dtcs.yaml +42 -0
  33. dtcs-0.1.0/pyproject.toml +40 -0
  34. dtcs-0.1.0/python/dtcs/__init__.py +56 -0
  35. dtcs-0.1.0/python/dtcs/__main__.py +151 -0
  36. dtcs-0.1.0/python/dtcs/py.typed +0 -0
  37. dtcs-0.1.0/python/tests/test_dtcs.py +65 -0
  38. dtcs-0.1.0/src/bin/dtcs.rs +12 -0
  39. dtcs-0.1.0/src/cli/mod.rs +210 -0
  40. dtcs-0.1.0/src/compatibility/mod.rs +4 -0
  41. dtcs-0.1.0/src/diagnostics/builders.rs +36 -0
  42. dtcs-0.1.0/src/diagnostics/category.rs +25 -0
  43. dtcs-0.1.0/src/diagnostics/codes.rs +28 -0
  44. dtcs-0.1.0/src/diagnostics/diagnostic.rs +60 -0
  45. dtcs-0.1.0/src/diagnostics/mod.rs +37 -0
  46. dtcs-0.1.0/src/diagnostics/report.rs +52 -0
  47. dtcs-0.1.0/src/diagnostics/severity.rs +23 -0
  48. dtcs-0.1.0/src/diagnostics/stage.rs +21 -0
  49. dtcs-0.1.0/src/lib.rs +91 -0
  50. dtcs-0.1.0/src/model/action.rs +29 -0
  51. dtcs-0.1.0/src/model/contract.rs +99 -0
  52. dtcs-0.1.0/src/model/expression.rs +13 -0
  53. dtcs-0.1.0/src/model/extension.rs +13 -0
  54. dtcs-0.1.0/src/model/function.rs +12 -0
  55. dtcs-0.1.0/src/model/interface.rs +28 -0
  56. dtcs-0.1.0/src/model/lineage.rs +21 -0
  57. dtcs-0.1.0/src/model/metadata.rs +19 -0
  58. dtcs-0.1.0/src/model/mod.rs +31 -0
  59. dtcs-0.1.0/src/model/registry.rs +13 -0
  60. dtcs-0.1.0/src/model/rule.rs +43 -0
  61. dtcs-0.1.0/src/model/semantics.rs +11 -0
  62. dtcs-0.1.0/src/model/types.rs +117 -0
  63. dtcs-0.1.0/src/model/versioning.rs +11 -0
  64. dtcs-0.1.0/src/parser/json.rs +13 -0
  65. dtcs-0.1.0/src/parser/mod.rs +117 -0
  66. dtcs-0.1.0/src/parser/yaml.rs +13 -0
  67. dtcs-0.1.0/src/plan/mod.rs +4 -0
  68. dtcs-0.1.0/src/python.rs +120 -0
  69. dtcs-0.1.0/src/validation/com.rs +19 -0
  70. dtcs-0.1.0/src/validation/context.rs +162 -0
  71. dtcs-0.1.0/src/validation/document.rs +56 -0
  72. dtcs-0.1.0/src/validation/extensions.rs +9 -0
  73. dtcs-0.1.0/src/validation/field_index.rs +170 -0
  74. dtcs-0.1.0/src/validation/lineage.rs +121 -0
  75. dtcs-0.1.0/src/validation/mod.rs +47 -0
  76. dtcs-0.1.0/src/validation/phases.rs +33 -0
  77. dtcs-0.1.0/src/validation/references.rs +124 -0
  78. dtcs-0.1.0/src/validation/semantics.rs +177 -0
  79. dtcs-0.1.0/src/validation/structural.rs +133 -0
  80. dtcs-0.1.0/src/validation/types.rs +78 -0
  81. dtcs-0.1.0/tests/fixtures/bare_composite_type.yaml +22 -0
  82. dtcs-0.1.0/tests/fixtures/duplicate_input_id.yaml +24 -0
  83. dtcs-0.1.0/tests/fixtures/duplicate_schema_field.yaml +25 -0
  84. dtcs-0.1.0/tests/fixtures/invalid_identifier.yaml +22 -0
  85. dtcs-0.1.0/tests/fixtures/invalid_rule.yaml +27 -0
  86. dtcs-0.1.0/tests/fixtures/invalid_semantic_action.yaml +12 -0
  87. dtcs-0.1.0/tests/fixtures/invalid_type.yaml +18 -0
  88. dtcs-0.1.0/tests/fixtures/malformed.json +1 -0
  89. dtcs-0.1.0/tests/fixtures/malformed.yaml +1 -0
  90. dtcs-0.1.0/tests/fixtures/missing_inputs.yaml +11 -0
  91. dtcs-0.1.0/tests/fixtures/missing_lineage.yaml +18 -0
  92. dtcs-0.1.0/tests/fixtures/orphan_output_in_lineage.yaml +22 -0
  93. dtcs-0.1.0/tests/fixtures/semantic_type_mismatch.yaml +26 -0
  94. dtcs-0.1.0/tests/fixtures/typo_top_level_field.yaml +13 -0
  95. dtcs-0.1.0/tests/fixtures/unknown_lineage_input.yaml +22 -0
  96. dtcs-0.1.0/tests/fixtures/unresolved_reference.yaml +22 -0
  97. dtcs-0.1.0/tests/fixtures/unsupported_version.yaml +22 -0
  98. dtcs-0.1.0/tests/fixtures/valid_customer.yaml +42 -0
  99. dtcs-0.1.0/tests/fixtures/valid_minimal.json +31 -0
  100. dtcs-0.1.0/tests/mvp.rs +360 -0
@@ -0,0 +1,18 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ trim_trailing_whitespace = true
8
+
9
+ [*.md]
10
+ trim_trailing_whitespace = false
11
+
12
+ [*.{rs,toml}]
13
+ indent_style = space
14
+ indent_size = 4
15
+
16
+ [*.yaml]
17
+ indent_style = space
18
+ indent_size = 2
@@ -0,0 +1,47 @@
1
+ name: Checks
2
+
3
+ on:
4
+ workflow_call:
5
+
6
+ env:
7
+ CARGO_TERM_COLOR: always
8
+
9
+ jobs:
10
+ python:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: dtolnay/rust-toolchain@stable
15
+ - uses: actions/setup-python@v5
16
+ with:
17
+ python-version: "3.12"
18
+ - name: Build and test Python package
19
+ run: |
20
+ python -m venv .venv
21
+ source .venv/bin/activate
22
+ python -m pip install --upgrade pip
23
+ python -m pip install maturin pytest
24
+ maturin develop --features python --locked
25
+ pytest python/tests -v
26
+ - name: maturin build (dry run)
27
+ run: |
28
+ source .venv/bin/activate
29
+ maturin build --features python --locked
30
+
31
+ rust:
32
+ runs-on: ubuntu-latest
33
+ steps:
34
+ - uses: actions/checkout@v4
35
+ - uses: dtolnay/rust-toolchain@stable
36
+ with:
37
+ components: rustfmt, clippy
38
+ - name: cargo fmt
39
+ run: cargo fmt --all -- --check
40
+ - name: cargo clippy
41
+ run: cargo clippy --all-targets -- -D warnings
42
+ - name: cargo test
43
+ run: cargo test --locked
44
+ - name: cargo build
45
+ run: cargo build --locked --all-targets
46
+ - name: cargo publish (dry run)
47
+ run: cargo publish --dry-run --locked
@@ -0,0 +1,9 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ checks:
9
+ uses: ./.github/workflows/checks.yml
@@ -0,0 +1,44 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ env:
9
+ CARGO_TERM_COLOR: always
10
+ CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
11
+ MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
12
+
13
+ jobs:
14
+ checks:
15
+ uses: ./.github/workflows/checks.yml
16
+
17
+ publish:
18
+ needs: checks
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: dtolnay/rust-toolchain@stable
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+ - name: Verify tag matches crate and Python versions
27
+ run: |
28
+ crate_version=$(grep '^version' Cargo.toml | head -1 | cut -d'"' -f2)
29
+ py_version=$(grep '^version' pyproject.toml | head -1 | cut -d'"' -f2)
30
+ tag_version="${GITHUB_REF_NAME#v}"
31
+ if [ "$crate_version" != "$tag_version" ]; then
32
+ echo "Tag ${GITHUB_REF_NAME} (v${tag_version}) does not match Cargo.toml version ${crate_version}"
33
+ exit 1
34
+ fi
35
+ if [ "$py_version" != "$tag_version" ]; then
36
+ echo "Tag ${GITHUB_REF_NAME} (v${tag_version}) does not match pyproject.toml version ${py_version}"
37
+ exit 1
38
+ fi
39
+ - name: cargo publish
40
+ run: cargo publish --locked --token "$CARGO_REGISTRY_TOKEN"
41
+ - name: Publish Python package to PyPI
42
+ run: |
43
+ pip install maturin
44
+ maturin publish --features python --locked
dtcs-0.1.0/.gitignore ADDED
@@ -0,0 +1,28 @@
1
+ # Rust
2
+ /target/
3
+ **/*.rs.bk
4
+
5
+ # Editor and OS
6
+ .DS_Store
7
+ *.swp
8
+ *.swo
9
+ *~
10
+ .idea/
11
+ .vscode/
12
+ .cursor/
13
+ *.code-workspace
14
+
15
+ # Environment
16
+ .env
17
+ .env.*
18
+
19
+ # Python
20
+ __pycache__/
21
+ *.py[cod]
22
+ *.so
23
+ *.egg-info/
24
+ .eggs/
25
+ dist/
26
+ .python-version
27
+ venv/
28
+ .venv/
@@ -0,0 +1,50 @@
1
+ # Contributing to DTCS
2
+
3
+ Thank you for contributing to the Data Transformation Contract Standard and its reference implementation.
4
+
5
+ ## Specification changes
6
+
7
+ Normative changes belong in [SPEC.md](SPEC.md). Follow the editorial process documented in:
8
+
9
+ - [docs/editorial/baseline.md](docs/editorial/baseline.md) — mandatory editorial conventions
10
+ - [docs/editorial/style-guide.md](docs/editorial/style-guide.md) — terminology and prose style
11
+ - [docs/editorial/authoring-guide.md](docs/editorial/authoring-guide.md) — chapter structure and normative language
12
+ - [docs/editorial/review-checklist.md](docs/editorial/review-checklist.md) — pre-publication review
13
+
14
+ ### Normative language
15
+
16
+ Use RFC 2119 / RFC 8174 keywords (`MUST`, `SHALL`, `SHOULD`, `MAY`, etc.) for requirements.
17
+
18
+ ### Authority
19
+
20
+ [SPEC.md](SPEC.md) is the single source of truth for semantics, terminology, and conformance. Implementation docs in [docs/implementation/](docs/implementation/) are illustrative unless explicitly normative.
21
+
22
+ ## Implementation changes
23
+
24
+ The Rust reference crate lives in [src/](src/). Before implementing a module:
25
+
26
+ 1. Read the relevant [SPEC.md](SPEC.md) chapter(s).
27
+ 2. Consult [docs/implementation/](docs/implementation/) for architecture and API guidance.
28
+ 3. Preserve spec-aligned naming and behavior.
29
+ 4. Add tests that exercise spec requirements. See [docs/implementation/testing-plan.md](docs/implementation/testing-plan.md).
30
+
31
+ ### Scope
32
+
33
+ The initial crate targets parsing, the canonical object model, validation, and diagnostics. Do not add execution, compilation, or runtime features without an agreed milestone. See [docs/implementation/non-goals.md](docs/implementation/non-goals.md).
34
+
35
+ ### Code style
36
+
37
+ - Run `cargo fmt` and `cargo clippy` before submitting changes.
38
+ - Keep modules aligned with [docs/implementation/crate-layout.md](docs/implementation/crate-layout.md).
39
+ - Prefer conservative behavior when the spec is ambiguous; document open questions with a `TODO` referencing the spec section.
40
+
41
+ ## Pull requests
42
+
43
+ 1. Describe whether the change is specification, implementation, or editorial.
44
+ 2. Link related issues or design discussions when available.
45
+ 3. Include or update tests for behavioral changes.
46
+ 4. Ensure `cargo test` passes.
47
+
48
+ ## Questions
49
+
50
+ For ambiguous spec language, open an issue with the relevant chapter and section number rather than inventing behavior in code.