domainforge 0.13.0
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/.cargo/config.toml +6 -0
- package/.claude/settings.local.json +18 -0
- package/.coderabbit.yml +43 -0
- package/.codex/skills/release-management/SKILL.md +151 -0
- package/.codex/skills/release-management/agents/openai.yaml +4 -0
- package/.github/actions/decrypt-secrets/action.yml +121 -0
- package/.github/agents/Coder.agent.md +97 -0
- package/.github/agents/DeepResearch.agent.md +61 -0
- package/.github/chatmodes/tdd.vibepro.chatmode.md +1183 -0
- package/.github/copilot-instructions.md +13 -0
- package/.github/dependabot.yml +68 -0
- package/.github/workflows/README.md +165 -0
- package/.github/workflows/ci.yml +335 -0
- package/.github/workflows/dependabot-automerge.yml +114 -0
- package/.github/workflows/dependency-review.yml +27 -0
- package/.github/workflows/deploy.yml +87 -0
- package/.github/workflows/prepare-release.yml +168 -0
- package/.github/workflows/release-crates.yml +42 -0
- package/.github/workflows/release-npm.yml +137 -0
- package/.github/workflows/release-please.yml +29 -0
- package/.github/workflows/release-pypi.yml +96 -0
- package/.gitkeep +1 -0
- package/.release-please-manifest.json +5 -0
- package/.sea-registry.toml +10 -0
- package/.serena/project.yml +133 -0
- package/.sops.yaml +10 -0
- package/AGENTS.md +216 -0
- package/CHANGELOG.md +400 -0
- package/CLAUDE.md +62 -0
- package/CONTRIBUTING.md +323 -0
- package/Cargo.lock +3612 -0
- package/Cargo.toml +12 -0
- package/LICENSE +201 -0
- package/README.md +660 -0
- package/README_PYTHON.md +256 -0
- package/README_TYPESCRIPT.md +305 -0
- package/README_WASM.md +329 -0
- package/RELEASE_NOTES.md +41 -0
- package/bun.lock +378 -0
- package/bunfig.toml +11 -0
- package/check_output.txt +83 -0
- package/clippy_output.txt +80 -0
- package/commitlint.config.cjs +8 -0
- package/deny.toml +42 -0
- package/devbox.json +14 -0
- package/devbox.lock +76 -0
- package/docs/RELEASE_PROCESS.md +360 -0
- package/docs/diagnostics.md +161 -0
- package/docs/doc_guidelines.md +53 -0
- package/docs/explanations/README.md +21 -0
- package/docs/explanations/architecture-overview.md +109 -0
- package/docs/explanations/cross-language-binding-strategy.md +68 -0
- package/docs/explanations/graph-store-design.md +47 -0
- package/docs/explanations/performance-benchmarks.md +63 -0
- package/docs/explanations/policy-evaluation-logic.md +106 -0
- package/docs/explanations/semantic-modeling-concepts.md +109 -0
- package/docs/explanations/three-valued-logic.md +66 -0
- package/docs/explanations/versioning-strategy.md +45 -0
- package/docs/governance.md +168 -0
- package/docs/how-tos/README.md +46 -0
- package/docs/how-tos/ci-cd-validation.md +93 -0
- package/docs/how-tos/create-custom-units.md +125 -0
- package/docs/how-tos/define-policies.md +119 -0
- package/docs/how-tos/export-to-calm.md +110 -0
- package/docs/how-tos/export-to-protobuf.md +312 -0
- package/docs/how-tos/extend-grammar.md +133 -0
- package/docs/how-tos/generate-rdf-turtle.md +106 -0
- package/docs/how-tos/import-from-calm.md +114 -0
- package/docs/how-tos/import-from-sbvr.md +249 -0
- package/docs/how-tos/install-cli.md +126 -0
- package/docs/how-tos/parse-sea-files.md +132 -0
- package/docs/how-tos/policy-evaluation-modes.md +30 -0
- package/docs/how-tos/run-cross-language-tests.md +115 -0
- package/docs/how-tos/troubleshoot-napi-builds.md +55 -0
- package/docs/how-tos/use-modules-imports.md +285 -0
- package/docs/index.md +13 -0
- package/docs/plans/canonical-normalizer.md +121 -0
- package/docs/plans/cd_improvement.md +112 -0
- package/docs/plans/cli-ast.md +29 -0
- package/docs/plans/expression-bindings-and-normalizer-integration.md +174 -0
- package/docs/plans/protobuf_advanced_features_plan.md +597 -0
- package/docs/plans/protobuf_plan.yml +525 -0
- package/docs/plans/refactor_dsl_architecture.md +131 -0
- package/docs/plans/release-plan.md +163 -0
- package/docs/plans/sea_fmt_implementation_plan.md +516 -0
- package/docs/playbooks/README.md +18 -0
- package/docs/playbooks/adding-new-primitive.md +68 -0
- package/docs/playbooks/debugging-parser-failures.md +42 -0
- package/docs/playbooks/local-release-preparation.md +139 -0
- package/docs/playbooks/migrating-schema-versions.md +43 -0
- package/docs/playbooks/onboarding-contributors.md +64 -0
- package/docs/playbooks/releasing-beta.md +86 -0
- package/docs/playbooks/secret-management.md +64 -0
- package/docs/reference/README.md +199 -0
- package/docs/reference/ast-json-api.md +427 -0
- package/docs/reference/calm-mapping.md +519 -0
- package/docs/reference/cli-commands.md +588 -0
- package/docs/reference/configuration.md +202 -0
- package/docs/reference/error-codes.md +664 -0
- package/docs/reference/generated-artifacts-policy.md +53 -0
- package/docs/reference/grammar-spec.md +255 -0
- package/docs/reference/primitives-api.md +317 -0
- package/docs/reference/protobuf-api.md +426 -0
- package/docs/reference/python-api.md +485 -0
- package/docs/reference/registry.md +50 -0
- package/docs/reference/sea-dsl-ai-cheatsheet.yaml +913 -0
- package/docs/reference/security-model.md +74 -0
- package/docs/reference/typescript-api.md +508 -0
- package/docs/reference/wasm-api.md +420 -0
- package/docs/semantic-pack-review.md +144 -0
- package/docs/semantic-pack-signing.md +234 -0
- package/docs/semantic-packs.md +284 -0
- package/docs/specs/ADR-001-sea-dsl-semantic-source-of-truth.md +33 -0
- package/docs/specs/ADR-002-projection-first-class-construct.md +50 -0
- package/docs/specs/ADR-003-protobuf-projection-target.md +51 -0
- package/docs/specs/ADR-004-projection-compatibility-semantics.md +57 -0
- package/docs/specs/ADR-005-multi-language-support-strategy.md +112 -0
- package/docs/specs/ADR-006-error-handling-strategy.md +115 -0
- package/docs/specs/ADR-007-policy-evaluation-engine.md +95 -0
- package/docs/specs/ADR-008-knowledge-graph-integration.md +90 -0
- package/docs/specs/ADR-009-module-resolution-strategy.md +115 -0
- package/docs/specs/ADR-010-unit-system.md +106 -0
- package/docs/specs/PRD-001-sea-projection-framework.md +155 -0
- package/docs/specs/PRD-002-sea-cli-tooling.md +169 -0
- package/docs/specs/PRD-003-dsl-core-capabilities.md +275 -0
- package/docs/specs/README.md +62 -0
- package/docs/specs/SDS-001-protobuf-projection-engine.md +451 -0
- package/docs/specs/SDS-002-sea-core-architecture.md +268 -0
- package/docs/specs/SDS-003-parser-semantic-graph.md +377 -0
- package/docs/specs/SDS-004-policy-engine-design.md +362 -0
- package/docs/specs/SDS-005-knowledge-graph-module.md +364 -0
- package/docs/specs/SDS-006-calm-integration.md +367 -0
- package/docs/specs/SDS-007-sbvr-import.md +347 -0
- package/docs/templates/template_explanation.md +14 -0
- package/docs/templates/template_howto.md +21 -0
- package/docs/templates/template_playbook.md +21 -0
- package/docs/templates/template_reference.md +17 -0
- package/docs/templates/template_tutorial.md +24 -0
- package/docs/tutorials/README.md +12 -0
- package/docs/tutorials/first-sea-model.md +85 -0
- package/docs/tutorials/getting-started.md +98 -0
- package/docs/tutorials/python-binding-quickstart.md +107 -0
- package/docs/tutorials/typescript-binding-quickstart.md +91 -0
- package/docs/tutorials/wasm-in-browser.md +75 -0
- package/domainforge-core/CHANGELOG.md +138 -0
- package/domainforge-core/Cargo.toml +101 -0
- package/domainforge-core/MIGRATING.md +32 -0
- package/domainforge-core/README.md +197 -0
- package/domainforge-core/benchmark_results.txt +51 -0
- package/domainforge-core/build.rs +6 -0
- package/domainforge-core/deny.toml +31 -0
- package/domainforge-core/docs/specs/projections/sbvr_kg_mapping.md +43 -0
- package/domainforge-core/examples/basic.sea +7 -0
- package/domainforge-core/examples/cli/import_export_workflow.sh +38 -0
- package/domainforge-core/examples/cli/validate_example.sh +30 -0
- package/domainforge-core/examples/evolution_semantics.sea +31 -0
- package/domainforge-core/examples/parser_demo.rs +203 -0
- package/domainforge-core/grammar/sea.pest +408 -0
- package/domainforge-core/schemas/calm-v1.schema.json +170 -0
- package/domainforge-core/schemas/shacl/sea_shapes.ttl +19 -0
- package/domainforge-core/src/authority/compiler.rs +309 -0
- package/domainforge-core/src/authority/environment.rs +203 -0
- package/domainforge-core/src/authority/error.rs +164 -0
- package/domainforge-core/src/authority/fact_resolver.rs +224 -0
- package/domainforge-core/src/authority/mod.rs +25 -0
- package/domainforge-core/src/authority/pack.rs +133 -0
- package/domainforge-core/src/authority/policy.rs +224 -0
- package/domainforge-core/src/authority/resolver.rs +446 -0
- package/domainforge-core/src/authority/trace.rs +217 -0
- package/domainforge-core/src/authority/transform.rs +168 -0
- package/domainforge-core/src/authority/types.rs +617 -0
- package/domainforge-core/src/bin/domainforge.rs +25 -0
- package/domainforge-core/src/calm/export.rs +538 -0
- package/domainforge-core/src/calm/import.rs +1220 -0
- package/domainforge-core/src/calm/mod.rs +9 -0
- package/domainforge-core/src/calm/models.rs +108 -0
- package/domainforge-core/src/calm/sbvr_import.rs +9 -0
- package/domainforge-core/src/cli/authority.rs +149 -0
- package/domainforge-core/src/cli/format.rs +85 -0
- package/domainforge-core/src/cli/import.rs +133 -0
- package/domainforge-core/src/cli/mod.rs +64 -0
- package/domainforge-core/src/cli/normalize.rs +180 -0
- package/domainforge-core/src/cli/pack.rs +904 -0
- package/domainforge-core/src/cli/parse.rs +112 -0
- package/domainforge-core/src/cli/project.rs +294 -0
- package/domainforge-core/src/cli/registry.rs +41 -0
- package/domainforge-core/src/cli/test.rs +12 -0
- package/domainforge-core/src/cli/validate.rs +195 -0
- package/domainforge-core/src/cli/validate_kg.rs +80 -0
- package/domainforge-core/src/concept_id.rs +89 -0
- package/domainforge-core/src/error/diagnostics.rs +426 -0
- package/domainforge-core/src/error/fuzzy.rs +253 -0
- package/domainforge-core/src/error/mod.rs +13 -0
- package/domainforge-core/src/formatter/comments.rs +223 -0
- package/domainforge-core/src/formatter/config.rs +114 -0
- package/domainforge-core/src/formatter/mod.rs +22 -0
- package/domainforge-core/src/formatter/printer.rs +906 -0
- package/domainforge-core/src/graph/mod.rs +858 -0
- package/domainforge-core/src/graph/to_ast.rs +66 -0
- package/domainforge-core/src/kg.rs +1476 -0
- package/domainforge-core/src/kg_import.rs +251 -0
- package/domainforge-core/src/lib.rs +203 -0
- package/domainforge-core/src/module/mod.rs +1 -0
- package/domainforge-core/src/module/resolver.rs +260 -0
- package/domainforge-core/src/parser/ast.rs +2919 -0
- package/domainforge-core/src/parser/ast_convert.rs +494 -0
- package/domainforge-core/src/parser/ast_schema.rs +491 -0
- package/domainforge-core/src/parser/error.rs +291 -0
- package/domainforge-core/src/parser/lint.rs +39 -0
- package/domainforge-core/src/parser/mod.rs +193 -0
- package/domainforge-core/src/parser/printer.rs +702 -0
- package/domainforge-core/src/parser/profiles.rs +71 -0
- package/domainforge-core/src/parser/string_utils.rs +138 -0
- package/domainforge-core/src/patterns.rs +68 -0
- package/domainforge-core/src/policy/core.rs +1148 -0
- package/domainforge-core/src/policy/expression.rs +399 -0
- package/domainforge-core/src/policy/mod.rs +18 -0
- package/domainforge-core/src/policy/normalize.rs +1028 -0
- package/domainforge-core/src/policy/quantifier.rs +940 -0
- package/domainforge-core/src/policy/three_valued.rs +140 -0
- package/domainforge-core/src/policy/three_valued_microbench.rs +104 -0
- package/domainforge-core/src/policy/type_inference.rs +67 -0
- package/domainforge-core/src/policy/violation.rs +36 -0
- package/domainforge-core/src/primitives/concept_change.rs +61 -0
- package/domainforge-core/src/primitives/entity.rs +224 -0
- package/domainforge-core/src/primitives/flow.rs +111 -0
- package/domainforge-core/src/primitives/instance.rs +93 -0
- package/domainforge-core/src/primitives/mapping_contract.rs +50 -0
- package/domainforge-core/src/primitives/metric.rs +79 -0
- package/domainforge-core/src/primitives/mod.rs +25 -0
- package/domainforge-core/src/primitives/projection_contract.rs +50 -0
- package/domainforge-core/src/primitives/quantity.rs +56 -0
- package/domainforge-core/src/primitives/relation.rs +68 -0
- package/domainforge-core/src/primitives/resource.rs +237 -0
- package/domainforge-core/src/primitives/resource_instance.rs +88 -0
- package/domainforge-core/src/primitives/role.rs +49 -0
- package/domainforge-core/src/projection/buf.rs +404 -0
- package/domainforge-core/src/projection/contracts.rs +22 -0
- package/domainforge-core/src/projection/engine.rs +19 -0
- package/domainforge-core/src/projection/mod.rs +16 -0
- package/domainforge-core/src/projection/protobuf.rs +3331 -0
- package/domainforge-core/src/projection/registry.rs +43 -0
- package/domainforge-core/src/python/authority.rs +253 -0
- package/domainforge-core/src/python/error.rs +227 -0
- package/domainforge-core/src/python/formatter.rs +86 -0
- package/domainforge-core/src/python/graph.rs +366 -0
- package/domainforge-core/src/python/mod.rs +9 -0
- package/domainforge-core/src/python/policy.rs +651 -0
- package/domainforge-core/src/python/primitives.rs +796 -0
- package/domainforge-core/src/python/registry.rs +98 -0
- package/domainforge-core/src/python/semantic_pack.rs +619 -0
- package/domainforge-core/src/python/units.rs +96 -0
- package/domainforge-core/src/registry/mod.rs +432 -0
- package/domainforge-core/src/registry/tests.rs +210 -0
- package/domainforge-core/src/sbvr.rs +744 -0
- package/domainforge-core/src/semantic_pack/builder.rs +470 -0
- package/domainforge-core/src/semantic_pack/canonical_json.rs +184 -0
- package/domainforge-core/src/semantic_pack/diagnostics.rs +214 -0
- package/domainforge-core/src/semantic_pack/diff.rs +216 -0
- package/domainforge-core/src/semantic_pack/mod.rs +31 -0
- package/domainforge-core/src/semantic_pack/pack_set.rs +240 -0
- package/domainforge-core/src/semantic_pack/resolver.rs +437 -0
- package/domainforge-core/src/semantic_pack/review.rs +125 -0
- package/domainforge-core/src/semantic_pack/schema.rs +342 -0
- package/domainforge-core/src/semantic_pack/signing.rs +105 -0
- package/domainforge-core/src/semantic_pack/validator.rs +368 -0
- package/domainforge-core/src/semantic_version.rs +140 -0
- package/domainforge-core/src/test_utils.rs +12 -0
- package/domainforge-core/src/typescript/authority.rs +184 -0
- package/domainforge-core/src/typescript/error.rs +146 -0
- package/domainforge-core/src/typescript/formatter.rs +76 -0
- package/domainforge-core/src/typescript/graph.rs +391 -0
- package/domainforge-core/src/typescript/mod.rs +9 -0
- package/domainforge-core/src/typescript/policy.rs +564 -0
- package/domainforge-core/src/typescript/primitives.rs +784 -0
- package/domainforge-core/src/typescript/registry.rs +88 -0
- package/domainforge-core/src/typescript/semantic_pack.rs +470 -0
- package/domainforge-core/src/typescript/units.rs +76 -0
- package/domainforge-core/src/units/mod.rs +462 -0
- package/domainforge-core/src/uuid_module.rs +42 -0
- package/domainforge-core/src/validation_error.rs +818 -0
- package/domainforge-core/src/validation_result.rs +30 -0
- package/domainforge-core/src/wasm/authority.rs +192 -0
- package/domainforge-core/src/wasm/error.rs +145 -0
- package/domainforge-core/src/wasm/formatter.rs +69 -0
- package/domainforge-core/src/wasm/graph.rs +471 -0
- package/domainforge-core/src/wasm/mod.rs +16 -0
- package/domainforge-core/src/wasm/policy.rs +607 -0
- package/domainforge-core/src/wasm/primitives.rs +295 -0
- package/domainforge-core/src/wasm/semantic_pack.rs +471 -0
- package/domainforge-core/src/wasm/units.rs +62 -0
- package/domainforge-core/std/aws.sea +6 -0
- package/domainforge-core/std/core.sea +6 -0
- package/domainforge-core/std/http.sea +27 -0
- package/domainforge-core/tests/aggregation_enhanced_tests.rs +162 -0
- package/domainforge-core/tests/aggregation_eval_tests.rs +248 -0
- package/domainforge-core/tests/aggregation_integration_tests.rs +379 -0
- package/domainforge-core/tests/aggregation_parser_tests.rs +92 -0
- package/domainforge-core/tests/aggregation_tests.rs +102 -0
- package/domainforge-core/tests/authority_conformance_tests.rs +1173 -0
- package/domainforge-core/tests/calm_round_trip_tests.rs +283 -0
- package/domainforge-core/tests/calm_schema_validation_tests.rs +137 -0
- package/domainforge-core/tests/cast_operator_tests.rs +85 -0
- package/domainforge-core/tests/cli_binary_check.rs +37 -0
- package/domainforge-core/tests/cli_import_tests.rs +291 -0
- package/domainforge-core/tests/cli_path_traversal_tests.rs +124 -0
- package/domainforge-core/tests/cli_tests.rs +63 -0
- package/domainforge-core/tests/diagnostics_tests.rs +203 -0
- package/domainforge-core/tests/dimension_unit_tests.rs +80 -0
- package/domainforge-core/tests/entity_tests.rs +69 -0
- package/domainforge-core/tests/evolution_semantics_tests.rs +157 -0
- package/domainforge-core/tests/flow_tests.rs +78 -0
- package/domainforge-core/tests/flow_unit_validation_tests.rs +31 -0
- package/domainforge-core/tests/graph_integration_tests.rs +218 -0
- package/domainforge-core/tests/graph_tests.rs +626 -0
- package/domainforge-core/tests/import_parsing_tests.rs +23 -0
- package/domainforge-core/tests/instance_integration_tests.rs +98 -0
- package/domainforge-core/tests/instance_parsing_tests.rs +58 -0
- package/domainforge-core/tests/instance_tests.rs +61 -0
- package/domainforge-core/tests/kg_uri_encoding_tests.rs +53 -0
- package/domainforge-core/tests/lint_tests.rs +19 -0
- package/domainforge-core/tests/metric_tests.rs +143 -0
- package/domainforge-core/tests/module_resolution_tests.rs +100 -0
- package/domainforge-core/tests/namespace_registry_tests.rs +247 -0
- package/domainforge-core/tests/null_handling_tests.rs +26 -0
- package/domainforge-core/tests/parser_ast_v3.rs +53 -0
- package/domainforge-core/tests/parser_dimension_registry_tests.rs +20 -0
- package/domainforge-core/tests/parser_integration_tests.rs +294 -0
- package/domainforge-core/tests/parser_metadata_tests.rs +97 -0
- package/domainforge-core/tests/parser_resource_domain_only_graph_test.rs +21 -0
- package/domainforge-core/tests/parser_resource_limits_tests.rs +122 -0
- package/domainforge-core/tests/parser_tests.rs +512 -0
- package/domainforge-core/tests/pattern_semantics_tests.rs +87 -0
- package/domainforge-core/tests/phase_14_determinism_tests.rs +166 -0
- package/domainforge-core/tests/phase_15_validation_error_tests.rs +136 -0
- package/domainforge-core/tests/phase_16_unicode_tests.rs +248 -0
- package/domainforge-core/tests/phase_17_export_tests.rs +285 -0
- package/domainforge-core/tests/phase_17_round_trip_tests.rs +264 -0
- package/domainforge-core/tests/policy_tests.rs +635 -0
- package/domainforge-core/tests/primitives_integration_tests.rs +151 -0
- package/domainforge-core/tests/print_rdf_xml.rs +14 -0
- package/domainforge-core/tests/printer_tests.rs +204 -0
- package/domainforge-core/tests/profile_tests.rs +35 -0
- package/domainforge-core/tests/projection_contracts_tests.rs +154 -0
- package/domainforge-core/tests/protobuf_projection_tests.rs +199 -0
- package/domainforge-core/tests/quantity_tests.rs +41 -0
- package/domainforge-core/tests/rdf_xml_typed_literal_tests.rs +105 -0
- package/domainforge-core/tests/registry_schema_tests.rs +33 -0
- package/domainforge-core/tests/resource_tests.rs +50 -0
- package/domainforge-core/tests/resource_unit_tests.rs +24 -0
- package/domainforge-core/tests/roles_relations_tests.rs +61 -0
- package/domainforge-core/tests/round_trip_tests.rs +34 -0
- package/domainforge-core/tests/runtime_toggle_tests.rs +70 -0
- package/domainforge-core/tests/sbvr_fact_schema_tests.rs +60 -0
- package/domainforge-core/tests/sbvr_flow_facts_tests.rs +55 -0
- package/domainforge-core/tests/sbvr_parsing_tests.rs +53 -0
- package/domainforge-core/tests/semantic_pack_alias_resolution.rs +197 -0
- package/domainforge-core/tests/semantic_pack_build.rs +302 -0
- package/domainforge-core/tests/semantic_pack_consumer_smoke.rs +150 -0
- package/domainforge-core/tests/semantic_pack_pack_set.rs +160 -0
- package/domainforge-core/tests/semantic_pack_signing.rs +157 -0
- package/domainforge-core/tests/semantic_pack_three_valued.rs +250 -0
- package/domainforge-core/tests/semantic_pack_validate.rs +196 -0
- package/domainforge-core/tests/std_lib_tests.rs +37 -0
- package/domainforge-core/tests/temporal_evaluation_tests.rs +159 -0
- package/domainforge-core/tests/temporal_semantics_tests.rs +214 -0
- package/domainforge-core/tests/three_valued_quantifiers_tests.rs +164 -0
- package/domainforge-core/tests/turtle_entity_export_tests.rs +38 -0
- package/domainforge-core/tests/turtle_escaping_tests.rs +53 -0
- package/domainforge-core/tests/turtle_resource_export_tests.rs +34 -0
- package/domainforge-core/tests/type_inference_tests.rs +40 -0
- package/domainforge-core/tests/unicode_validation_tests.rs +169 -0
- package/domainforge-core/tests/unit_tests.rs +81 -0
- package/domainforge-core/tests/validate_tests.rs +38 -0
- package/domainforge-core/tests/validation_unit_mismatch_tests.rs +83 -0
- package/domainforge-core/tests/wasm_tests.rs +229 -0
- package/domainforge-python/CHANGELOG-python.md +12 -0
- package/domainforge-python/MIGRATING.md +24 -0
- package/domainforge-python/README.md +256 -0
- package/domainforge-python/domainforge/__init__.py +95 -0
- package/domainforge-python/domainforge/domainforge.pyi +519 -0
- package/domainforge-python/pyproject.toml +36 -0
- package/domainforge-typescript/CHANGELOG-typescript.md +12 -0
- package/domainforge-typescript/LICENSE +201 -0
- package/domainforge-typescript/MIGRATING.md +24 -0
- package/domainforge-typescript/README.md +305 -0
- package/domainforge-typescript/index.d.ts +452 -0
- package/domainforge-typescript/index.js +361 -0
- package/domainforge-typescript/package.json +60 -0
- package/example.js +61 -0
- package/examples/browser.html +366 -0
- package/examples/namespaces/finance/cashflow.sea +5 -0
- package/examples/namespaces/logistics/core.sea +7 -0
- package/examples/observability_metrics.sea +38 -0
- package/fixtures/semantic_packs/acme_procurement/domain/entities.sea +39 -0
- package/fixtures/semantic_packs/acme_procurement/domain/metrics.sea +11 -0
- package/fixtures/semantic_packs/acme_procurement/domain/relations.sea +7 -0
- package/fixtures/semantic_packs/acme_procurement/domain/resources.sea +9 -0
- package/fixtures/semantic_packs/acme_procurement/review/acme.procurement.semantic-review.jsonl +7 -0
- package/fixtures/semantic_packs/acme_procurement/tests/ambiguous_vendor_alias.sea +8 -0
- package/fixtures/semantic_packs/acme_procurement/tests/deprecated_vendor_alias.sea +8 -0
- package/fixtures/semantic_packs/acme_procurement/tests/invalid_relation.sea +3 -0
- package/fixtures/semantic_packs/acme_procurement/tests/proposed_concept.sea +8 -0
- package/fixtures/semantic_packs/acme_procurement/tests/rejected_concept.sea +8 -0
- package/fixtures/semantic_packs/acme_procurement/tests/unit_mismatch.sea +7 -0
- package/fixtures/semantic_packs/acme_procurement/tests/unknown_vendor_policy.sea +8 -0
- package/fixtures/semantic_packs/acme_procurement/tests/valid_purchase_policy.sea +8 -0
- package/index.d.ts +2 -0
- package/index.js +8 -0
- package/justfile +200 -0
- package/lefthook.yml +13 -0
- package/lib/validate_native_exports.d.ts +4 -0
- package/lib/validate_native_exports.js +12 -0
- package/package.json +22 -0
- package/pytest.ini +5 -0
- package/python/tests/test_registry.py +75 -0
- package/python/tests/test_units.py +18 -0
- package/release-please-config.json +49 -0
- package/requirements-dev.txt +3 -0
- package/requirements.txt +3 -0
- package/rust-toolchain.toml +3 -0
- package/schemas/ast-v1.schema.json +72 -0
- package/schemas/ast-v2.schema.json +1200 -0
- package/schemas/ast-v3.schema.json +1200 -0
- package/schemas/sea-registry.schema.json +45 -0
- package/scripts/build-python.sh +37 -0
- package/scripts/build-release.sh +279 -0
- package/scripts/build-typescript.sh +13 -0
- package/scripts/build-wasm.sh +113 -0
- package/scripts/bump-version.sh +245 -0
- package/scripts/check_unused_test_imports.py +85 -0
- package/scripts/ci_tasks.py +379 -0
- package/scripts/clear_debug_test.sh +10 -0
- package/scripts/create-github-release.sh +262 -0
- package/scripts/create-tag.sh +203 -0
- package/scripts/find_and_link_test_binary.sh +70 -0
- package/scripts/generate-changelog.sh +271 -0
- package/scripts/generate-release-notes.sh +205 -0
- package/scripts/lint_release_security.py +96 -0
- package/scripts/lint_release_workflows.py +82 -0
- package/scripts/lint_workflow_gates.py +113 -0
- package/scripts/optimized-wasm-build.sh +61 -0
- package/scripts/patch_napi_types.py +62 -0
- package/scripts/pre-release-check.sh +289 -0
- package/scripts/prepare_rust_debug.sh +52 -0
- package/scripts/release.sh +373 -0
- package/scripts/resolve_rust_binary.py +230 -0
- package/scripts/run_commitlint.sh +29 -0
- package/scripts/test-all.sh +77 -0
- package/scripts/update_launch_program.py +93 -0
- package/secrets/README.md +27 -0
- package/secrets/secrets.yaml +21 -0
- package/test_integration.py +67 -0
- package/tests/test_authority.py +328 -0
- package/tests/test_ci_tasks.py +143 -0
- package/tests/test_expression.py +256 -0
- package/tests/test_golden_payment_flow.py +42 -0
- package/tests/test_graph.py +127 -0
- package/tests/test_instance.py +136 -0
- package/tests/test_parser.py +82 -0
- package/tests/test_primitives.py +68 -0
- package/tests/test_role_relation_parity.py +56 -0
- package/tests/test_runtime_toggle.py +156 -0
- package/tests/test_semantic_pack.py +639 -0
- package/tests/test_three_valued_eval.py +159 -0
- package/tsconfig.json +30 -0
- package/typescript-tests/advanced.test.ts +165 -0
- package/typescript-tests/authority.test.ts +216 -0
- package/typescript-tests/expression.test.ts +228 -0
- package/typescript-tests/golden-payment-flow.test.ts +51 -0
- package/typescript-tests/graph.test.ts +142 -0
- package/typescript-tests/native-binding.test.ts +20 -0
- package/typescript-tests/primitives.test.ts +88 -0
- package/typescript-tests/registry.test.ts +122 -0
- package/typescript-tests/role_relation.test.ts +63 -0
- package/typescript-tests/runtime_toggle.test.ts +141 -0
- package/typescript-tests/semantic-pack.test.ts +556 -0
- package/typescript-tests/three_valued_eval.test.ts +135 -0
- package/typescript-tests/units.test.ts +36 -0
- package/vitest.config.ts +13 -0
- package/wasm_demo.html +225 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: Dependency Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
pull-requests: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
dependency-review:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
timeout-minutes: 5
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v6
|
|
17
|
+
with:
|
|
18
|
+
fetch-depth: 0 # Fetch full history for comparison
|
|
19
|
+
|
|
20
|
+
- name: Dependency Review
|
|
21
|
+
uses: actions/dependency-review-action@v4
|
|
22
|
+
with:
|
|
23
|
+
fail-on-severity: critical # Only fail on critical severity to be conservative
|
|
24
|
+
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, ISC, LGPL-3.0, BSL-1.0, Zlib, Unicode-3.0, Apache-2.0 WITH LLVM-exception
|
|
25
|
+
# Allow dependencies with non-standard SPDX license expressions (e.g., Apache-2.0/MIT)
|
|
26
|
+
# These are typically dual-licensed and safe, but use non-standard separators
|
|
27
|
+
allow-dependencies-licenses: pkg:cargo/minicov
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: Deploy
|
|
2
|
+
|
|
3
|
+
# Triggered by component-prefixed tags produced by release-please:
|
|
4
|
+
# domainforge-core-vX.Y.Z (Rust crate) -> release-crates.yml
|
|
5
|
+
# domainforge-vX.Y.Z (Python package) -> release-pypi.yml
|
|
6
|
+
# domainforge-typescript-vX.Y.Z (TypeScript @godspeedai/domainforge) -> release-npm.yml
|
|
7
|
+
#
|
|
8
|
+
# This workflow is a router: it parses the tag, then dispatches to the
|
|
9
|
+
# already-tested, reusable publish workflow that owns the build + publish
|
|
10
|
+
# logic for that component. There is intentionally no separate `prod`
|
|
11
|
+
# GitHub environment gate — this is a solo-maintainer repository where
|
|
12
|
+
# CI on `main` is the merge gate and a tag push is the release signal.
|
|
13
|
+
on:
|
|
14
|
+
push:
|
|
15
|
+
tags:
|
|
16
|
+
- 'domainforge-core-v*'
|
|
17
|
+
- 'domainforge-v*'
|
|
18
|
+
- 'domainforge-typescript-v*'
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
|
|
23
|
+
concurrency:
|
|
24
|
+
group: deploy-${{ github.ref }}
|
|
25
|
+
cancel-in-progress: false
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
identify:
|
|
29
|
+
name: Identify Component
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
outputs:
|
|
32
|
+
component: ${{ steps.parse.outputs.component }}
|
|
33
|
+
version: ${{ steps.parse.outputs.version }}
|
|
34
|
+
steps:
|
|
35
|
+
- name: Parse tag into component and version
|
|
36
|
+
id: parse
|
|
37
|
+
shell: bash
|
|
38
|
+
run: |
|
|
39
|
+
# GITHUB_REF_NAME on a tag push = the tag name, e.g. "domainforge-core-v0.12.0"
|
|
40
|
+
# component = everything before the last "-v"
|
|
41
|
+
# version = everything after the last "-v"
|
|
42
|
+
tag="${GITHUB_REF_NAME}"
|
|
43
|
+
component="${tag%-v*}"
|
|
44
|
+
version="${tag##*-v}"
|
|
45
|
+
echo "Parsed tag: $tag"
|
|
46
|
+
echo " component: $component"
|
|
47
|
+
echo " version: $version"
|
|
48
|
+
# Validate version matches semver pattern
|
|
49
|
+
if [[ ! "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?$ ]]; then
|
|
50
|
+
echo "::error::Invalid version format '$version' (expected semver X.Y.Z or X.Y.Z-prerelease)" >&2
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
case "$component" in
|
|
54
|
+
domainforge-core|domainforge|domainforge-typescript) ;;
|
|
55
|
+
*) echo "::error::Unknown component '$component' (expected domainforge-core|domainforge|domainforge-typescript)" >&2; exit 1 ;;
|
|
56
|
+
esac
|
|
57
|
+
echo "component=$component" >> "$GITHUB_OUTPUT"
|
|
58
|
+
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
59
|
+
|
|
60
|
+
deploy-crates:
|
|
61
|
+
name: Publish domainforge-core to crates.io
|
|
62
|
+
if: needs.identify.outputs.component == 'domainforge-core'
|
|
63
|
+
needs: identify
|
|
64
|
+
uses: ./.github/workflows/release-crates.yml
|
|
65
|
+
secrets: inherit
|
|
66
|
+
permissions:
|
|
67
|
+
contents: read
|
|
68
|
+
packages: write
|
|
69
|
+
|
|
70
|
+
deploy-pypi:
|
|
71
|
+
name: Publish domainforge wheels to PyPI
|
|
72
|
+
if: needs.identify.outputs.component == 'domainforge'
|
|
73
|
+
needs: identify
|
|
74
|
+
uses: ./.github/workflows/release-pypi.yml
|
|
75
|
+
secrets: inherit
|
|
76
|
+
permissions:
|
|
77
|
+
contents: read
|
|
78
|
+
packages: write
|
|
79
|
+
|
|
80
|
+
deploy-npm:
|
|
81
|
+
name: Publish @godspeedai/domainforge to npm
|
|
82
|
+
if: needs.identify.outputs.component == 'domainforge-typescript'
|
|
83
|
+
needs: identify
|
|
84
|
+
uses: ./.github/workflows/release-npm.yml
|
|
85
|
+
secrets: inherit
|
|
86
|
+
permissions:
|
|
87
|
+
contents: read
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
name: Prepare Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
version_bump:
|
|
7
|
+
description: 'Version bump type'
|
|
8
|
+
required: true
|
|
9
|
+
type: choice
|
|
10
|
+
options:
|
|
11
|
+
- patch
|
|
12
|
+
- minor
|
|
13
|
+
- major
|
|
14
|
+
prerelease:
|
|
15
|
+
description: 'Pre-release suffix (leave empty for stable release)'
|
|
16
|
+
required: false
|
|
17
|
+
type: string
|
|
18
|
+
default: ''
|
|
19
|
+
|
|
20
|
+
permissions:
|
|
21
|
+
contents: write
|
|
22
|
+
pull-requests: write
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
prepare:
|
|
26
|
+
name: Prepare Release PR
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v6
|
|
30
|
+
with:
|
|
31
|
+
fetch-depth: 0
|
|
32
|
+
|
|
33
|
+
- name: Install Rust toolchain
|
|
34
|
+
uses: dtolnay/rust-toolchain@stable
|
|
35
|
+
with:
|
|
36
|
+
toolchain: stable
|
|
37
|
+
|
|
38
|
+
- name: Install cargo-edit
|
|
39
|
+
run: cargo install cargo-edit --locked
|
|
40
|
+
|
|
41
|
+
- name: Get current version
|
|
42
|
+
id: current
|
|
43
|
+
run: |
|
|
44
|
+
CURRENT=$(cargo metadata --manifest-path domainforge-core/Cargo.toml --format-version 1 | jq -r '.packages[] | select(.name == "domainforge-core") | .version')
|
|
45
|
+
echo "version=$CURRENT" >> "$GITHUB_OUTPUT"
|
|
46
|
+
echo "Current version: $CURRENT"
|
|
47
|
+
|
|
48
|
+
- name: Calculate new version
|
|
49
|
+
id: newversion
|
|
50
|
+
run: |
|
|
51
|
+
CURRENT="${{ steps.current.outputs.version }}"
|
|
52
|
+
BUMP="${{ github.event.inputs.version_bump }}"
|
|
53
|
+
PRERELEASE="${{ github.event.inputs.prerelease }}"
|
|
54
|
+
|
|
55
|
+
# Parse current version (strip any existing pre-release suffix)
|
|
56
|
+
IFS='.' read -r MAJOR MINOR PATCH <<< "${CURRENT%-*}"
|
|
57
|
+
|
|
58
|
+
# Bump version based on type
|
|
59
|
+
case "$BUMP" in
|
|
60
|
+
major)
|
|
61
|
+
MAJOR=$((MAJOR + 1))
|
|
62
|
+
MINOR=0
|
|
63
|
+
PATCH=0
|
|
64
|
+
;;
|
|
65
|
+
minor)
|
|
66
|
+
MINOR=$((MINOR + 1))
|
|
67
|
+
PATCH=0
|
|
68
|
+
;;
|
|
69
|
+
patch)
|
|
70
|
+
PATCH=$((PATCH + 1))
|
|
71
|
+
;;
|
|
72
|
+
esac
|
|
73
|
+
|
|
74
|
+
NEW_VERSION="${MAJOR}.${MINOR}.${PATCH}"
|
|
75
|
+
if [ -n "$PRERELEASE" ]; then
|
|
76
|
+
NEW_VERSION="${NEW_VERSION}-${PRERELEASE}"
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
|
|
80
|
+
echo "New version: $NEW_VERSION"
|
|
81
|
+
|
|
82
|
+
- name: Bump Cargo.toml version
|
|
83
|
+
run: |
|
|
84
|
+
cargo set-version --manifest-path domainforge-core/Cargo.toml "${{ steps.newversion.outputs.version }}"
|
|
85
|
+
|
|
86
|
+
- name: Sync Python version (pyproject.toml)
|
|
87
|
+
run: |
|
|
88
|
+
NEW_VERSION="${{ steps.newversion.outputs.version }}"
|
|
89
|
+
sed -i "s/^version = \".*\"/version = \"$NEW_VERSION\"/" domainforge-python/pyproject.toml
|
|
90
|
+
echo "Updated domainforge-python/pyproject.toml to version $NEW_VERSION"
|
|
91
|
+
|
|
92
|
+
- name: Sync NPM version (package.json)
|
|
93
|
+
run: |
|
|
94
|
+
NEW_VERSION="${{ steps.newversion.outputs.version }}"
|
|
95
|
+
npm version "$NEW_VERSION" --no-git-tag-version --allow-same-version --prefix domainforge-typescript
|
|
96
|
+
echo "Updated domainforge-typescript/package.json to version $NEW_VERSION"
|
|
97
|
+
|
|
98
|
+
- name: Update CHANGELOG.md
|
|
99
|
+
run: |
|
|
100
|
+
NEW_VERSION="${{ steps.newversion.outputs.version }}"
|
|
101
|
+
DATE=$(date +%Y-%m-%d)
|
|
102
|
+
|
|
103
|
+
# Build the new changelog entry (use printf to avoid YAML comment issues with #)
|
|
104
|
+
H="###"
|
|
105
|
+
ENTRY=$(printf '%s\n' \
|
|
106
|
+
"## [${NEW_VERSION}] - ${DATE}" \
|
|
107
|
+
"" \
|
|
108
|
+
"${H} Added" \
|
|
109
|
+
"- (Add new features here)" \
|
|
110
|
+
"" \
|
|
111
|
+
"${H} Changed" \
|
|
112
|
+
"- (Add changes here)" \
|
|
113
|
+
"" \
|
|
114
|
+
"${H} Fixed" \
|
|
115
|
+
"- (Add bug fixes here)" \
|
|
116
|
+
"")
|
|
117
|
+
|
|
118
|
+
# Create updated changelog atomically
|
|
119
|
+
if [ -f CHANGELOG.md ]; then
|
|
120
|
+
# Find the first version heading line number
|
|
121
|
+
FIRST_VERSION_LINE=$(grep -n "^## \[" CHANGELOG.md | head -1 | cut -d: -f1)
|
|
122
|
+
if [ -n "$FIRST_VERSION_LINE" ]; then
|
|
123
|
+
# Has existing version entries - insert before it
|
|
124
|
+
head -n $((FIRST_VERSION_LINE - 1)) CHANGELOG.md > /tmp/changelog_new.md
|
|
125
|
+
echo "$ENTRY" >> /tmp/changelog_new.md
|
|
126
|
+
tail -n "+$FIRST_VERSION_LINE" CHANGELOG.md >> /tmp/changelog_new.md
|
|
127
|
+
else
|
|
128
|
+
# No version entries yet - append to file
|
|
129
|
+
cat CHANGELOG.md > /tmp/changelog_new.md
|
|
130
|
+
echo "" >> /tmp/changelog_new.md
|
|
131
|
+
echo "$ENTRY" >> /tmp/changelog_new.md
|
|
132
|
+
fi
|
|
133
|
+
mv /tmp/changelog_new.md CHANGELOG.md
|
|
134
|
+
else
|
|
135
|
+
# Create new CHANGELOG.md
|
|
136
|
+
echo "# Changelog" > CHANGELOG.md
|
|
137
|
+
echo "" >> CHANGELOG.md
|
|
138
|
+
echo "$ENTRY" >> CHANGELOG.md
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
- name: Create Pull Request
|
|
142
|
+
uses: peter-evans/create-pull-request@v6
|
|
143
|
+
with:
|
|
144
|
+
token: ${{ secrets.CREATE_PR_TOKEN }}
|
|
145
|
+
commit-message: "chore: bump version to ${{ steps.newversion.outputs.version }}"
|
|
146
|
+
branch: release/${{ steps.newversion.outputs.version }}
|
|
147
|
+
title: "Release v${{ steps.newversion.outputs.version }}"
|
|
148
|
+
body: |
|
|
149
|
+
## Release v${{ steps.newversion.outputs.version }}
|
|
150
|
+
|
|
151
|
+
This PR was automatically created by the prepare-release workflow.
|
|
152
|
+
|
|
153
|
+
### Checklist
|
|
154
|
+
- [ ] Update CHANGELOG.md with actual changes
|
|
155
|
+
- [ ] Review version bump in `domainforge-core/Cargo.toml`
|
|
156
|
+
- [ ] Run `just all-tests` locally
|
|
157
|
+
- [ ] Merge this PR
|
|
158
|
+
- [ ] Create and push tag: `git tag v${{ steps.newversion.outputs.version }} && git push --tags`
|
|
159
|
+
- [ ] Create GitHub Release from the tag to trigger publishing
|
|
160
|
+
|
|
161
|
+
### Version Changes
|
|
162
|
+
- **Previous**: ${{ steps.current.outputs.version }}
|
|
163
|
+
- **New**: ${{ steps.newversion.outputs.version }}
|
|
164
|
+
- **Bump Type**: ${{ github.event.inputs.version_bump }}
|
|
165
|
+
labels: |
|
|
166
|
+
release
|
|
167
|
+
automated
|
|
168
|
+
draft: false
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Release Crates
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
packages: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
publish:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
|
|
17
|
+
- name: Decrypt secrets
|
|
18
|
+
id: secrets
|
|
19
|
+
uses: ./.github/actions/decrypt-secrets
|
|
20
|
+
with:
|
|
21
|
+
sops-age-key: ${{ secrets.SOPS_AGE_KEY }}
|
|
22
|
+
|
|
23
|
+
- name: Install Rust toolchain
|
|
24
|
+
uses: dtolnay/rust-toolchain@stable
|
|
25
|
+
with:
|
|
26
|
+
toolchain: stable
|
|
27
|
+
|
|
28
|
+
- name: Publish domainforge-core to crates.io
|
|
29
|
+
run: |
|
|
30
|
+
set +e
|
|
31
|
+
OUTPUT=$(cargo publish --manifest-path domainforge-core/Cargo.toml --token ${{ steps.secrets.outputs.cargo-registry-token }} 2>&1)
|
|
32
|
+
EXIT_CODE=$?
|
|
33
|
+
echo "$OUTPUT"
|
|
34
|
+
|
|
35
|
+
# Check if already published (not an error)
|
|
36
|
+
if echo "$OUTPUT" | grep -q "already uploaded\|already exists\|is already published"; then
|
|
37
|
+
echo "::notice::Crate version already published, skipping"
|
|
38
|
+
exit 0
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
# Propagate actual errors
|
|
42
|
+
exit $EXIT_CODE
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
name: Release NPM
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
name: Publish napi bindings to npm
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v6
|
|
16
|
+
|
|
17
|
+
- name: Decrypt secrets
|
|
18
|
+
id: secrets
|
|
19
|
+
uses: ./.github/actions/decrypt-secrets
|
|
20
|
+
with:
|
|
21
|
+
sops-age-key: ${{ secrets.SOPS_AGE_KEY }}
|
|
22
|
+
|
|
23
|
+
- name: Set up Node.js
|
|
24
|
+
uses: actions/setup-node@v6
|
|
25
|
+
with:
|
|
26
|
+
node-version: "24"
|
|
27
|
+
registry-url: "https://registry.npmjs.org"
|
|
28
|
+
|
|
29
|
+
- name: Set up Bun
|
|
30
|
+
uses: oven-sh/setup-bun@v2
|
|
31
|
+
with:
|
|
32
|
+
bun-version: latest
|
|
33
|
+
|
|
34
|
+
- name: Install Rust toolchain
|
|
35
|
+
uses: dtolnay/rust-toolchain@stable
|
|
36
|
+
with:
|
|
37
|
+
toolchain: stable
|
|
38
|
+
|
|
39
|
+
- name: Install dependencies
|
|
40
|
+
run: bun install --frozen-lockfile
|
|
41
|
+
|
|
42
|
+
- name: Build napi package
|
|
43
|
+
working-directory: domainforge-typescript
|
|
44
|
+
run: npm run build
|
|
45
|
+
|
|
46
|
+
- name: Patch generated TypeScript declarations
|
|
47
|
+
working-directory: domainforge-typescript
|
|
48
|
+
run: python3 ../scripts/patch_napi_types.py
|
|
49
|
+
|
|
50
|
+
- name: Smoke test npm pack
|
|
51
|
+
working-directory: domainforge-typescript
|
|
52
|
+
run: |
|
|
53
|
+
npm pack --dry-run 2>&1 | tee /tmp/npm-pack-output.txt
|
|
54
|
+
grep -q "index.d.ts" /tmp/npm-pack-output.txt || { echo "ERROR: index.d.ts missing from pack"; exit 1; }
|
|
55
|
+
grep -q "index.js" /tmp/npm-pack-output.txt || { echo "ERROR: index.js missing from pack"; exit 1; }
|
|
56
|
+
grep -q "domainforge-core.*.node" /tmp/npm-pack-output.txt || { echo "ERROR: native .node binary missing from pack"; exit 1; }
|
|
57
|
+
echo "npm pack smoke test passed"
|
|
58
|
+
|
|
59
|
+
- name: Check if already published
|
|
60
|
+
working-directory: domainforge-typescript
|
|
61
|
+
run: |
|
|
62
|
+
if npm view "@godspeedai/domainforge@$(node -p "require('./package.json').version")" version >/dev/null 2>&1; then
|
|
63
|
+
echo "Already published, skipping"
|
|
64
|
+
echo "SKIP_PUBLISH=1" >> $GITHUB_ENV
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
- name: Publish to npm
|
|
68
|
+
if: env.SKIP_PUBLISH != '1'
|
|
69
|
+
working-directory: domainforge-typescript
|
|
70
|
+
run: npm publish --access public --ignore-scripts
|
|
71
|
+
env:
|
|
72
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || steps.secrets.outputs.npm-token }}
|
|
73
|
+
|
|
74
|
+
publish-wasm:
|
|
75
|
+
name: Publish WASM package to npm
|
|
76
|
+
runs-on: ubuntu-latest
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v6
|
|
79
|
+
|
|
80
|
+
- name: Decrypt secrets
|
|
81
|
+
id: secrets
|
|
82
|
+
uses: ./.github/actions/decrypt-secrets
|
|
83
|
+
with:
|
|
84
|
+
sops-age-key: ${{ secrets.SOPS_AGE_KEY }}
|
|
85
|
+
|
|
86
|
+
- name: Set up Node.js
|
|
87
|
+
uses: actions/setup-node@v6
|
|
88
|
+
with:
|
|
89
|
+
node-version: "24"
|
|
90
|
+
registry-url: "https://registry.npmjs.org"
|
|
91
|
+
|
|
92
|
+
- name: Install Rust toolchain
|
|
93
|
+
uses: dtolnay/rust-toolchain@stable
|
|
94
|
+
with:
|
|
95
|
+
toolchain: stable
|
|
96
|
+
targets: wasm32-unknown-unknown
|
|
97
|
+
|
|
98
|
+
- name: Install wasm-pack
|
|
99
|
+
run: cargo install wasm-pack --locked
|
|
100
|
+
|
|
101
|
+
- name: Build WASM package
|
|
102
|
+
run: |
|
|
103
|
+
cd domainforge-core
|
|
104
|
+
wasm-pack build --target web --release --scope godspeedai -- --features wasm
|
|
105
|
+
node - <<'NODE'
|
|
106
|
+
const fs = require('fs');
|
|
107
|
+
const pkgPath = 'pkg/package.json';
|
|
108
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
109
|
+
pkg.name = '@godspeedai/domainforge-wasm';
|
|
110
|
+
pkg.files = ['domainforge_core.js', 'domainforge_core.d.ts', 'domainforge_core_bg.wasm', 'domainforge_core_bg.wasm.d.ts'];
|
|
111
|
+
fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + '\n');
|
|
112
|
+
NODE
|
|
113
|
+
|
|
114
|
+
- name: WASM smoke test
|
|
115
|
+
run: |
|
|
116
|
+
cd domainforge-core/pkg
|
|
117
|
+
for f in domainforge_core.js domainforge_core.d.ts domainforge_core_bg.wasm domainforge_core_bg.wasm.d.ts package.json; do
|
|
118
|
+
test -f "$f" || { echo "ERROR: missing $f in WASM pkg"; exit 1; }
|
|
119
|
+
done
|
|
120
|
+
node -e "const p=require('./package.json'); if (p.name !== '@godspeedai/domainforge-wasm') throw new Error('Unexpected package name: ' + p.name); ['version','main','types'].forEach(k => { if(!p[k]) throw new Error('Missing field: ' + k) })"
|
|
121
|
+
echo "WASM smoke test passed"
|
|
122
|
+
|
|
123
|
+
- name: Check if WASM already published
|
|
124
|
+
run: |
|
|
125
|
+
cd domainforge-core/pkg
|
|
126
|
+
if npm view "@godspeedai/domainforge-wasm@$(node -p "require('./package.json').version")" version >/dev/null 2>&1; then
|
|
127
|
+
echo "Already published, skipping"
|
|
128
|
+
echo "SKIP_PUBLISH=1" >> $GITHUB_ENV
|
|
129
|
+
fi
|
|
130
|
+
|
|
131
|
+
- name: Publish WASM to npm
|
|
132
|
+
if: env.SKIP_PUBLISH != '1'
|
|
133
|
+
run: |
|
|
134
|
+
cd domainforge-core/pkg
|
|
135
|
+
npm publish --access public
|
|
136
|
+
env:
|
|
137
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN || steps.secrets.outputs.npm-token }}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Release Please
|
|
2
|
+
|
|
3
|
+
# Triggered on every push to main (the integration branch).
|
|
4
|
+
# release-please scans conventional commits and opens/updates release PRs.
|
|
5
|
+
on:
|
|
6
|
+
push:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: release-please
|
|
11
|
+
cancel-in-progress: false
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: write
|
|
15
|
+
pull-requests: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
release-please:
|
|
19
|
+
name: Release Please
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: googleapis/release-please-action@5c625bfb5d1ff62eadeeb3772007f7f66fdcf071
|
|
23
|
+
with:
|
|
24
|
+
# PAT (not GITHUB_TOKEN) so that tags created on release-PR merge
|
|
25
|
+
# propagate `push: tags` events to deploy.yml. GITHUB_TOKEN-created
|
|
26
|
+
# refs do not trigger downstream workflows.
|
|
27
|
+
token: ${{ secrets.CREATE_PR_TOKEN }}
|
|
28
|
+
config-file: release-please-config.json
|
|
29
|
+
manifest-file: .release-please-manifest.json
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
name: Release PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_call:
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
packages: write
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
build-and-publish:
|
|
13
|
+
name: Publish Wheels (${{ matrix.os }}, ${{ matrix.target }})
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
fail-fast: false
|
|
17
|
+
matrix:
|
|
18
|
+
include:
|
|
19
|
+
# x86_64 targets
|
|
20
|
+
- os: ubuntu-latest
|
|
21
|
+
target: x86_64-unknown-linux-gnu
|
|
22
|
+
- os: macos-15-intel
|
|
23
|
+
target: x86_64-apple-darwin
|
|
24
|
+
- os: windows-2025-vs2026
|
|
25
|
+
target: x86_64-pc-windows-msvc
|
|
26
|
+
# ARM targets
|
|
27
|
+
- os: macos-15
|
|
28
|
+
target: aarch64-apple-darwin
|
|
29
|
+
- os: ubuntu-latest
|
|
30
|
+
target: aarch64-unknown-linux-gnu
|
|
31
|
+
use_zig: true
|
|
32
|
+
steps:
|
|
33
|
+
- uses: actions/checkout@v6
|
|
34
|
+
|
|
35
|
+
- name: Decrypt secrets
|
|
36
|
+
id: secrets
|
|
37
|
+
uses: ./.github/actions/decrypt-secrets
|
|
38
|
+
with:
|
|
39
|
+
sops-age-key: ${{ secrets.SOPS_AGE_KEY }}
|
|
40
|
+
|
|
41
|
+
- name: Set up Python
|
|
42
|
+
uses: actions/setup-python@v6
|
|
43
|
+
with:
|
|
44
|
+
python-version: "3.11"
|
|
45
|
+
|
|
46
|
+
- name: Install Rust toolchain
|
|
47
|
+
uses: dtolnay/rust-toolchain@stable
|
|
48
|
+
with:
|
|
49
|
+
toolchain: stable
|
|
50
|
+
targets: ${{ matrix.target }}
|
|
51
|
+
|
|
52
|
+
- name: Ensure Rust target is installed
|
|
53
|
+
run: rustup target add ${{ matrix.target }}
|
|
54
|
+
|
|
55
|
+
- name: Install maturin
|
|
56
|
+
run: pip install maturin==1.10.1
|
|
57
|
+
|
|
58
|
+
- name: Install Zig (for ARM Linux cross-compile)
|
|
59
|
+
if: matrix.use_zig == true
|
|
60
|
+
shell: bash
|
|
61
|
+
run: |
|
|
62
|
+
ZIG_VERSION="0.11.0"
|
|
63
|
+
ZIG_SHA256="2d00e789fec4f71790a6e7bf83ff91d564943c5ee843c5fd966efc474b423047"
|
|
64
|
+
ZIG_URL="https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
|
|
65
|
+
curl -sSLo "$RUNNER_TEMP/zig.tar.xz" "$ZIG_URL"
|
|
66
|
+
echo "${ZIG_SHA256} $RUNNER_TEMP/zig.tar.xz" | sha256sum -c -
|
|
67
|
+
mkdir -p "$RUNNER_TEMP/zig"
|
|
68
|
+
tar -xJf "$RUNNER_TEMP/zig.tar.xz" -C "$RUNNER_TEMP/zig" --strip-components=1
|
|
69
|
+
echo "$RUNNER_TEMP/zig" >> "$GITHUB_PATH"
|
|
70
|
+
"$RUNNER_TEMP/zig/zig" version
|
|
71
|
+
|
|
72
|
+
- name: Build and publish wheels (native)
|
|
73
|
+
if: matrix.use_zig != true
|
|
74
|
+
shell: bash
|
|
75
|
+
working-directory: domainforge-python
|
|
76
|
+
run: |
|
|
77
|
+
python -m maturin publish \
|
|
78
|
+
--features python \
|
|
79
|
+
--target ${{ matrix.target }} \
|
|
80
|
+
--skip-existing
|
|
81
|
+
env:
|
|
82
|
+
MATURIN_PYPI_TOKEN: ${{ steps.secrets.outputs.pypi-api-token || secrets.PYPI_API_TOKEN }}
|
|
83
|
+
|
|
84
|
+
- name: Build and publish wheels (cross-compile with Zig)
|
|
85
|
+
if: matrix.use_zig == true
|
|
86
|
+
shell: bash
|
|
87
|
+
working-directory: domainforge-python
|
|
88
|
+
run: |
|
|
89
|
+
python -m maturin publish \
|
|
90
|
+
--features python \
|
|
91
|
+
--target ${{ matrix.target }} \
|
|
92
|
+
--skip-existing \
|
|
93
|
+
--zig \
|
|
94
|
+
-i python3.11
|
|
95
|
+
env:
|
|
96
|
+
MATURIN_PYPI_TOKEN: ${{ steps.secrets.outputs.pypi-api-token || secrets.PYPI_API_TOKEN }}
|
package/.gitkeep
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This repo intentionally leaves a placeholder at the root to indicate the presence of core assets.
|