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,13 @@
|
|
|
1
|
+
# Copilot Instructions
|
|
2
|
+
|
|
3
|
+
Use [AGENTS.md](../AGENTS.md) as the canonical source of repository-wide instructions.
|
|
4
|
+
|
|
5
|
+
Copilot-specific rules:
|
|
6
|
+
|
|
7
|
+
- Follow `AGENTS.md` for workflow, testing, routing, and state-management behavior.
|
|
8
|
+
- Use `.agents/` as the active shared work-state store.
|
|
9
|
+
- Treat `.agents/` as the only current agent-state directory in this repository.
|
|
10
|
+
- If `.agents/` or its required subfolders are missing and the task needs them, create them before continuing.
|
|
11
|
+
- Keep `.github/copilot-instructions.md` minimal; do not duplicate repository policy here.
|
|
12
|
+
- When work spans multiple steps or handoff is likely, update `.agents/current_state.md` and `.agents/next_steps.md`.
|
|
13
|
+
- You MUST read and follow the instructions in `AGENTS.md` and `.agents/current_state.md` before taking any action.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
updates:
|
|
4
|
+
# ---------------------------------------------------------
|
|
5
|
+
# Rust (Cargo)
|
|
6
|
+
# ---------------------------------------------------------
|
|
7
|
+
- package-ecosystem: "cargo"
|
|
8
|
+
directory: "/domainforge-core"
|
|
9
|
+
schedule:
|
|
10
|
+
interval: "weekly"
|
|
11
|
+
day: "monday"
|
|
12
|
+
time: "04:00"
|
|
13
|
+
open-pull-requests-limit: 10
|
|
14
|
+
labels:
|
|
15
|
+
- "dependencies"
|
|
16
|
+
- "rust"
|
|
17
|
+
- "automerge"
|
|
18
|
+
- "safe-to-merge"
|
|
19
|
+
commit-message:
|
|
20
|
+
prefix: "chore(deps)"
|
|
21
|
+
include: "scope"
|
|
22
|
+
ignore:
|
|
23
|
+
- dependency-name: "*"
|
|
24
|
+
update-types: ["version-update:semver-major"]
|
|
25
|
+
|
|
26
|
+
# ---------------------------------------------------------
|
|
27
|
+
# JavaScript/TypeScript (npm)
|
|
28
|
+
# ---------------------------------------------------------
|
|
29
|
+
- package-ecosystem: "npm"
|
|
30
|
+
directory: "/domainforge-typescript"
|
|
31
|
+
schedule:
|
|
32
|
+
interval: "weekly"
|
|
33
|
+
day: "monday"
|
|
34
|
+
time: "04:00"
|
|
35
|
+
open-pull-requests-limit: 10
|
|
36
|
+
labels:
|
|
37
|
+
- "dependencies"
|
|
38
|
+
- "typescript"
|
|
39
|
+
- "automerge"
|
|
40
|
+
- "safe-to-merge"
|
|
41
|
+
commit-message:
|
|
42
|
+
prefix: "chore(deps)"
|
|
43
|
+
include: "scope"
|
|
44
|
+
ignore:
|
|
45
|
+
- dependency-name: "*"
|
|
46
|
+
update-types: ["version-update:semver-major"]
|
|
47
|
+
|
|
48
|
+
# ---------------------------------------------------------
|
|
49
|
+
# GitHub Actions
|
|
50
|
+
# ---------------------------------------------------------
|
|
51
|
+
- package-ecosystem: "github-actions"
|
|
52
|
+
directory: "/"
|
|
53
|
+
schedule:
|
|
54
|
+
interval: "weekly"
|
|
55
|
+
day: "monday"
|
|
56
|
+
time: "04:00"
|
|
57
|
+
open-pull-requests-limit: 5
|
|
58
|
+
labels:
|
|
59
|
+
- "dependencies"
|
|
60
|
+
- "ci"
|
|
61
|
+
- "automerge"
|
|
62
|
+
- "safe-to-merge"
|
|
63
|
+
commit-message:
|
|
64
|
+
prefix: "chore(deps)"
|
|
65
|
+
include: "scope"
|
|
66
|
+
ignore:
|
|
67
|
+
- dependency-name: "*"
|
|
68
|
+
update-types: ["version-update:semver-major"]
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
# GitHub Workflows Documentation
|
|
2
|
+
|
|
3
|
+
This directory contains the CI/CD workflows for the DomainForge project.
|
|
4
|
+
|
|
5
|
+
## Workflows Overview
|
|
6
|
+
|
|
7
|
+
| Workflow | Trigger | Purpose |
|
|
8
|
+
| -------------------------- | -------------------------------- | ----------------------------------------- |
|
|
9
|
+
| `ci.yml` | Push to main/release/**, PRs | Continuous Integration |
|
|
10
|
+
| `release.yml` | Tag `v*.*.*` | Build artifacts, create release, dispatch publishes |
|
|
11
|
+
| `release-npm.yml` | `workflow_call` from release.yml | Publish napi + WASM to npm |
|
|
12
|
+
| `release-pypi.yml` | `workflow_call` from release.yml | Publish Python wheels to PyPI |
|
|
13
|
+
| `release-crates.yml` | `workflow_call` from release.yml | Publish to crates.io |
|
|
14
|
+
| `prepare-release.yml` | Manual trigger | Automate version bump and release PR |
|
|
15
|
+
| `dependabot-automerge.yml` | Dependabot PRs | Auto-merge safe dependency updates |
|
|
16
|
+
| `dependency-review.yml` | PRs | Review dependency changes for security |
|
|
17
|
+
|
|
18
|
+
## Workflow Details
|
|
19
|
+
|
|
20
|
+
### `ci.yml` - Continuous Integration
|
|
21
|
+
|
|
22
|
+
Main CI pipeline that runs on pushes to `main` and `release/**` branches, as well as pull requests targeting `main`.
|
|
23
|
+
|
|
24
|
+
**Jobs:**
|
|
25
|
+
|
|
26
|
+
- **lint**: Runs `rustfmt` and `clippy` on all Rust code
|
|
27
|
+
- **test-rust**: Runs Rust tests on Linux, macOS, and Windows
|
|
28
|
+
- **test-python**: Runs Python tests on Python 3.11 and 3.12
|
|
29
|
+
- **test-typescript**: Runs TypeScript/Vitest tests
|
|
30
|
+
- **test-integration**: Minimal integration checks including registry ambiguity validation
|
|
31
|
+
- **test-wasm**: Builds and validates WASM bundle size
|
|
32
|
+
- **security**: Runs `cargo audit` for security vulnerabilities
|
|
33
|
+
|
|
34
|
+
### `release.yml` - Release Builds
|
|
35
|
+
|
|
36
|
+
Triggered on version tags (`v*.*.*`). Builds release artifacts for all platforms.
|
|
37
|
+
|
|
38
|
+
**Supported Targets:**
|
|
39
|
+
|
|
40
|
+
| Target | OS Runner | Notes |
|
|
41
|
+
| --------------------------- | -------------- | -------------------------- |
|
|
42
|
+
| `x86_64-unknown-linux-gnu` | ubuntu-latest | Standard Linux |
|
|
43
|
+
| `x86_64-apple-darwin` | macos-15-intel | Intel Mac |
|
|
44
|
+
| `x86_64-pc-windows-msvc` | windows-2025-vs2026 | Windows |
|
|
45
|
+
| `aarch64-apple-darwin` | macos-15 | Apple Silicon |
|
|
46
|
+
| `aarch64-unknown-linux-gnu` | ubuntu-latest | ARM Linux (cross-compiled) |
|
|
47
|
+
|
|
48
|
+
**Jobs:**
|
|
49
|
+
|
|
50
|
+
- **build-release**: Builds CLI binaries for all targets
|
|
51
|
+
- **build-python-wheels**: Builds Python wheels for all targets
|
|
52
|
+
- **build-wasm-release**: Builds optimized WASM bundle
|
|
53
|
+
- **create-release**: Creates GitHub release with all artifacts
|
|
54
|
+
- **publish-pypi**: Calls `release-pypi.yml` to publish wheels to PyPI
|
|
55
|
+
- **publish-npm**: Calls `release-npm.yml` to publish napi + WASM to npm
|
|
56
|
+
- **publish-crates**: Calls `release-crates.yml` to publish `domainforge-core` to crates.io
|
|
57
|
+
|
|
58
|
+
### `prepare-release.yml` - Release Automation
|
|
59
|
+
|
|
60
|
+
Manually triggered workflow to automate version bumping and release PR creation.
|
|
61
|
+
|
|
62
|
+
**Inputs:**
|
|
63
|
+
|
|
64
|
+
- `version_bump`: Choose `patch`, `minor`, or `major`
|
|
65
|
+
- `prerelease`: Optional suffix like `alpha`, `beta`, or `rc1`
|
|
66
|
+
|
|
67
|
+
**What it does:**
|
|
68
|
+
|
|
69
|
+
1. Calculates new version based on bump type
|
|
70
|
+
2. Updates `domainforge-core/Cargo.toml` with new version
|
|
71
|
+
3. Prepares CHANGELOG.md entry
|
|
72
|
+
4. Creates a release PR with checklist
|
|
73
|
+
|
|
74
|
+
### Publishing Workflows
|
|
75
|
+
|
|
76
|
+
| Workflow | Registry | Notes |
|
|
77
|
+
| -------------------- | --------- | ------------------------------------------------ |
|
|
78
|
+
| `release-npm.yml` | npm | Publishes both napi bindings AND WASM package |
|
|
79
|
+
| `release-pypi.yml` | PyPI | Publishes wheels for all platforms including ARM |
|
|
80
|
+
| `release-crates.yml` | crates.io | Publishes `domainforge-core` crate |
|
|
81
|
+
|
|
82
|
+
## Bundle Size Thresholds
|
|
83
|
+
|
|
84
|
+
| Artifact | Limit | Notes |
|
|
85
|
+
| ------------ | ----- | ---------------------------------------- |
|
|
86
|
+
| WASM bundle | 2.5MB | Harmonized across ci.yml and release.yml |
|
|
87
|
+
| CLI binary | 50MB | Per-platform binary |
|
|
88
|
+
| CLI artifact | 70MB | Packaged archive (tar.gz/zip) |
|
|
89
|
+
|
|
90
|
+
## Local Testing to Match CI
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Run all tests
|
|
94
|
+
just all-tests
|
|
95
|
+
|
|
96
|
+
# Or individually
|
|
97
|
+
just rust-test
|
|
98
|
+
just python-test
|
|
99
|
+
just ts-test
|
|
100
|
+
|
|
101
|
+
# WASM build and size check
|
|
102
|
+
cd domainforge-core
|
|
103
|
+
wasm-pack build --target web --features wasm
|
|
104
|
+
SIZE=$(python3 -c "import os; print(os.path.getsize('pkg/domainforge_core_bg.wasm'))")
|
|
105
|
+
echo "WASM bundle size: $SIZE bytes (threshold: 2621440)"
|
|
106
|
+
[ "$SIZE" -lt 2621440 ] && echo "PASS" || echo "FAIL"
|
|
107
|
+
|
|
108
|
+
# Lint checks
|
|
109
|
+
cargo fmt --all --check
|
|
110
|
+
cargo clippy --all-targets --all-features -- -D warnings
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Release Process
|
|
114
|
+
|
|
115
|
+
### Automated (Recommended)
|
|
116
|
+
|
|
117
|
+
1. Go to Actions → "Prepare Release" → Run workflow
|
|
118
|
+
2. Select version bump type (patch/minor/major)
|
|
119
|
+
3. Review and merge the created PR
|
|
120
|
+
4. Create and push tag: `git tag v<version> && git push --tags`
|
|
121
|
+
5. `release.yml` runs automatically on the tag: it builds artifacts, creates the GitHub Release, and then calls the three publish workflows (`release-pypi.yml`, `release-npm.yml`, `release-crates.yml`) via `workflow_call`.
|
|
122
|
+
|
|
123
|
+
> **Note:** Publishing is dispatched by `release.yml` via `workflow_call`, not by the `release: published` event. This is intentional: events produced by the default `GITHUB_TOKEN` do not trigger downstream workflows, so relying on `release: published` would silently skip publishing when the release is created automatically. Calling the publish workflows directly from `release.yml` is deterministic and requires no extra tokens.
|
|
124
|
+
|
|
125
|
+
### Manual
|
|
126
|
+
|
|
127
|
+
1. Bump version in `domainforge-core/Cargo.toml`
|
|
128
|
+
2. Update `CHANGELOG.md`
|
|
129
|
+
3. Commit and push
|
|
130
|
+
4. Create and push tag: `git tag v<version> && git push --tags`
|
|
131
|
+
5. `release.yml` builds, creates the release, and dispatches publishes automatically
|
|
132
|
+
|
|
133
|
+
## Cache Management
|
|
134
|
+
|
|
135
|
+
All workflows use GitHub Actions cache (v5) with a `CACHE_VERSION` environment variable. To bust all caches:
|
|
136
|
+
|
|
137
|
+
1. Increment `CACHE_VERSION` in the workflow file
|
|
138
|
+
2. This is useful when dependencies are corrupted or need a fresh start
|
|
139
|
+
|
|
140
|
+
## Secrets Required
|
|
141
|
+
|
|
142
|
+
| Secret | Used By | Purpose |
|
|
143
|
+
| ---------------- | --------------------- | ----------------------------- |
|
|
144
|
+
| `SOPS_AGE_KEY` | All publish workflows | Decrypt encrypted secrets |
|
|
145
|
+
| `PYPI_API_TOKEN` | release-pypi.yml | PyPI publishing (fallback) |
|
|
146
|
+
| `GITHUB_TOKEN` | All workflows | GitHub API access (automatic) |
|
|
147
|
+
|
|
148
|
+
## Troubleshooting
|
|
149
|
+
|
|
150
|
+
### ARM Linux Cross-Compilation
|
|
151
|
+
|
|
152
|
+
ARM Linux targets use either `cross` (for CLI) or `zig` (for Python wheels) for cross-compilation. If builds fail:
|
|
153
|
+
|
|
154
|
+
1. Check that the target toolchain is installed
|
|
155
|
+
2. Verify cross/zig are working correctly
|
|
156
|
+
3. ARM Linux builds cannot be verified locally on x86 runners
|
|
157
|
+
|
|
158
|
+
### Publish Failures
|
|
159
|
+
|
|
160
|
+
All publish workflows have `continue-on-error: true` or `--skip-existing` to handle:
|
|
161
|
+
|
|
162
|
+
- Package already published (re-runs)
|
|
163
|
+
- Network issues (will fail but won't block other jobs)
|
|
164
|
+
|
|
165
|
+
To check if a publish actually succeeded, verify the package on the respective registry.
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
concurrency:
|
|
4
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
5
|
+
cancel-in-progress: true
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main, release/**]
|
|
10
|
+
pull_request:
|
|
11
|
+
branches: [main]
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
security-events: write
|
|
16
|
+
|
|
17
|
+
env:
|
|
18
|
+
CARGO_TERM_COLOR: always
|
|
19
|
+
RUST_BACKTRACE: 1
|
|
20
|
+
CARGO_INCREMENTAL: 0
|
|
21
|
+
CACHE_VERSION: v4 # Increment to bust all caches
|
|
22
|
+
CLI_MAX_BYTES: "52428800" # 50MB
|
|
23
|
+
WASM_MAX_BYTES: "2621440" # 2.5MB
|
|
24
|
+
|
|
25
|
+
jobs:
|
|
26
|
+
lint:
|
|
27
|
+
name: Lint & Format
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
timeout-minutes: 10
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v6
|
|
32
|
+
|
|
33
|
+
- name: Install Rust toolchain
|
|
34
|
+
uses: dtolnay/rust-toolchain@stable
|
|
35
|
+
with:
|
|
36
|
+
components: rustfmt, clippy
|
|
37
|
+
|
|
38
|
+
- name: Cache cargo registry
|
|
39
|
+
uses: actions/cache@v5
|
|
40
|
+
with:
|
|
41
|
+
path: ~/.cargo/registry/index
|
|
42
|
+
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-cargo-index
|
|
43
|
+
|
|
44
|
+
- name: Cache cargo build
|
|
45
|
+
uses: actions/cache@v5
|
|
46
|
+
with:
|
|
47
|
+
path: |
|
|
48
|
+
~/.cargo/registry/cache
|
|
49
|
+
~/.cargo/git/db
|
|
50
|
+
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
51
|
+
restore-keys: |
|
|
52
|
+
${{ runner.os }}-${{ env.CACHE_VERSION }}-cargo-
|
|
53
|
+
|
|
54
|
+
- name: Run rustfmt
|
|
55
|
+
run: cargo fmt --all --check
|
|
56
|
+
|
|
57
|
+
- name: Run clippy
|
|
58
|
+
run: cargo clippy --all-targets --all-features -- -D warnings
|
|
59
|
+
|
|
60
|
+
test-rust:
|
|
61
|
+
name: Test Rust (${{ matrix.os }})
|
|
62
|
+
needs: lint
|
|
63
|
+
timeout-minutes: 30
|
|
64
|
+
strategy:
|
|
65
|
+
fail-fast: false
|
|
66
|
+
matrix:
|
|
67
|
+
include:
|
|
68
|
+
- os: ubuntu-latest
|
|
69
|
+
target: x86_64-unknown-linux-gnu
|
|
70
|
+
- os: macos-latest
|
|
71
|
+
target: aarch64-apple-darwin
|
|
72
|
+
- os: windows-2025-vs2026
|
|
73
|
+
target: x86_64-pc-windows-msvc
|
|
74
|
+
runs-on: ${{ matrix.os }}
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v6
|
|
77
|
+
|
|
78
|
+
- name: Install Rust toolchain
|
|
79
|
+
uses: dtolnay/rust-toolchain@stable
|
|
80
|
+
with:
|
|
81
|
+
targets: ${{ matrix.target }}
|
|
82
|
+
|
|
83
|
+
- name: Install just
|
|
84
|
+
uses: extractions/setup-just@v4
|
|
85
|
+
|
|
86
|
+
- name: Cache dependencies
|
|
87
|
+
uses: actions/cache@v5
|
|
88
|
+
with:
|
|
89
|
+
path: |
|
|
90
|
+
~/.cargo/registry/index
|
|
91
|
+
~/.cargo/registry/cache
|
|
92
|
+
~/.cargo/git/db
|
|
93
|
+
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
94
|
+
restore-keys: |
|
|
95
|
+
${{ runner.os }}-${{ env.CACHE_VERSION }}-cargo-
|
|
96
|
+
|
|
97
|
+
- name: Run unit tests
|
|
98
|
+
run: just ci-test-rust
|
|
99
|
+
|
|
100
|
+
- name: Build release CLI binary (verify)
|
|
101
|
+
run: |
|
|
102
|
+
cd domainforge-core
|
|
103
|
+
cargo build --release --target ${{ matrix.target }} --features cli
|
|
104
|
+
|
|
105
|
+
- name: Resolve CLI binary path
|
|
106
|
+
if: matrix.os != 'windows-2025-vs2026'
|
|
107
|
+
run: |
|
|
108
|
+
CLI_BIN=$(python3 scripts/resolve_rust_binary.py --workspace "$(pwd)" --name domainforge --profile release --target-triple ${{ matrix.target }} --require-executable)
|
|
109
|
+
echo "Resolved CLI binary: $CLI_BIN"
|
|
110
|
+
echo "CLI_BIN=$CLI_BIN" >> "$GITHUB_ENV"
|
|
111
|
+
|
|
112
|
+
- name: Resolve CLI binary path (windows)
|
|
113
|
+
if: matrix.os == 'windows-2025-vs2026'
|
|
114
|
+
shell: pwsh
|
|
115
|
+
run: |
|
|
116
|
+
$workspace = (Get-Location).Path
|
|
117
|
+
$cliBin = python scripts/resolve_rust_binary.py --workspace "$workspace" --name domainforge --profile release --target-triple ${{ matrix.target }} --require-executable
|
|
118
|
+
Write-Host "Resolved CLI binary: $cliBin"
|
|
119
|
+
"CLI_BIN=$cliBin" >> $env:GITHUB_ENV
|
|
120
|
+
|
|
121
|
+
- name: Verify CLI binary executes
|
|
122
|
+
run: just ci-verify-binary "${{ env.CLI_BIN }}"
|
|
123
|
+
|
|
124
|
+
- name: Check CLI binary size
|
|
125
|
+
run: just ci-check-binary-size "${{ env.CLI_BIN }}" "${{ env.CLI_MAX_BYTES }}"
|
|
126
|
+
|
|
127
|
+
test-python:
|
|
128
|
+
name: Test Python (${{ matrix.python-version }})
|
|
129
|
+
needs: lint
|
|
130
|
+
timeout-minutes: 30
|
|
131
|
+
strategy:
|
|
132
|
+
fail-fast: false
|
|
133
|
+
matrix:
|
|
134
|
+
os: [ubuntu-latest]
|
|
135
|
+
python-version: ["3.11", "3.12"]
|
|
136
|
+
runs-on: ${{ matrix.os }}
|
|
137
|
+
steps:
|
|
138
|
+
- uses: actions/checkout@v6
|
|
139
|
+
|
|
140
|
+
- name: Set up Python
|
|
141
|
+
uses: actions/setup-python@v6
|
|
142
|
+
with:
|
|
143
|
+
python-version: ${{ matrix.python-version }}
|
|
144
|
+
|
|
145
|
+
- name: Install Rust toolchain
|
|
146
|
+
uses: dtolnay/rust-toolchain@stable
|
|
147
|
+
|
|
148
|
+
- name: Install just
|
|
149
|
+
uses: extractions/setup-just@v4
|
|
150
|
+
|
|
151
|
+
- name: Cache dependencies
|
|
152
|
+
uses: actions/cache@v5
|
|
153
|
+
with:
|
|
154
|
+
path: |
|
|
155
|
+
~/.cargo/registry/index
|
|
156
|
+
~/.cargo/registry/cache
|
|
157
|
+
~/.cargo/git/db
|
|
158
|
+
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-py${{ matrix.python-version }}-${{ hashFiles('**/Cargo.lock', 'requirements*.txt') }}
|
|
159
|
+
restore-keys: |
|
|
160
|
+
${{ runner.os }}-${{ env.CACHE_VERSION }}-py${{ matrix.python-version }}-
|
|
161
|
+
|
|
162
|
+
- name: Setup Python environment
|
|
163
|
+
run: just python-setup
|
|
164
|
+
|
|
165
|
+
- name: Run Python tests
|
|
166
|
+
run: just ci-test-python
|
|
167
|
+
|
|
168
|
+
test-typescript:
|
|
169
|
+
name: Test TypeScript
|
|
170
|
+
needs: lint
|
|
171
|
+
timeout-minutes: 20
|
|
172
|
+
runs-on: ubuntu-latest
|
|
173
|
+
steps:
|
|
174
|
+
- uses: actions/checkout@v6
|
|
175
|
+
|
|
176
|
+
- name: Set up Node.js
|
|
177
|
+
uses: actions/setup-node@v6
|
|
178
|
+
with:
|
|
179
|
+
node-version: 24
|
|
180
|
+
|
|
181
|
+
- name: Set up Bun
|
|
182
|
+
uses: oven-sh/setup-bun@v2
|
|
183
|
+
with:
|
|
184
|
+
bun-version: latest
|
|
185
|
+
|
|
186
|
+
- name: Install Rust toolchain
|
|
187
|
+
uses: dtolnay/rust-toolchain@stable
|
|
188
|
+
|
|
189
|
+
- name: Install just
|
|
190
|
+
uses: extractions/setup-just@v4
|
|
191
|
+
|
|
192
|
+
- name: Cache dependencies
|
|
193
|
+
uses: actions/cache@v5
|
|
194
|
+
with:
|
|
195
|
+
path: |
|
|
196
|
+
~/.cargo/registry/index
|
|
197
|
+
~/.cargo/registry/cache
|
|
198
|
+
~/.cargo/git/db
|
|
199
|
+
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-ts-${{ hashFiles('**/Cargo.lock', 'bun.lock') }}
|
|
200
|
+
restore-keys: |
|
|
201
|
+
${{ runner.os }}-${{ env.CACHE_VERSION }}-ts-
|
|
202
|
+
|
|
203
|
+
- name: Install dependencies
|
|
204
|
+
run: bun install --frozen-lockfile
|
|
205
|
+
|
|
206
|
+
- name: Build TypeScript bindings
|
|
207
|
+
# Build inside domainforge-typescript/ (where the napi package + config live).
|
|
208
|
+
# Root index.js re-exports domainforge-typescript/index.js, so the test loader
|
|
209
|
+
# (imported by tests via '../index') resolves the native binary in place.
|
|
210
|
+
run: cd domainforge-typescript && bun run build
|
|
211
|
+
|
|
212
|
+
- name: Run TypeScript tests
|
|
213
|
+
run: just ci-test-ts
|
|
214
|
+
|
|
215
|
+
test-integration:
|
|
216
|
+
name: Minimal Integration Check
|
|
217
|
+
needs: [test-rust, test-typescript]
|
|
218
|
+
timeout-minutes: 20
|
|
219
|
+
runs-on: ubuntu-latest
|
|
220
|
+
steps:
|
|
221
|
+
- uses: actions/checkout@v6
|
|
222
|
+
|
|
223
|
+
- name: Install Rust toolchain
|
|
224
|
+
uses: dtolnay/rust-toolchain@stable
|
|
225
|
+
|
|
226
|
+
- name: Install Node
|
|
227
|
+
uses: actions/setup-node@v6
|
|
228
|
+
with:
|
|
229
|
+
node-version: 24
|
|
230
|
+
|
|
231
|
+
- name: Set up Bun
|
|
232
|
+
uses: oven-sh/setup-bun@v2
|
|
233
|
+
with:
|
|
234
|
+
bun-version: latest
|
|
235
|
+
|
|
236
|
+
- name: Build domainforge binary
|
|
237
|
+
run: cargo build -p domainforge-core --bin domainforge --features cli
|
|
238
|
+
|
|
239
|
+
- name: Build TypeScript bindings (minimal)
|
|
240
|
+
run: |
|
|
241
|
+
bun install --frozen-lockfile
|
|
242
|
+
cd domainforge-typescript && bun run build
|
|
243
|
+
|
|
244
|
+
- name: Minimal registry ambiguity check
|
|
245
|
+
shell: bash
|
|
246
|
+
run: |
|
|
247
|
+
tmpdir=$(mktemp -d)
|
|
248
|
+
tee "$tmpdir/.sea-registry.toml" > /dev/null <<'EOF'
|
|
249
|
+
version = 1
|
|
250
|
+
default_namespace = "default"
|
|
251
|
+
|
|
252
|
+
[[namespaces]]
|
|
253
|
+
namespace = "a"
|
|
254
|
+
patterns = ["domains/*/warehouse.sea"]
|
|
255
|
+
|
|
256
|
+
[[namespaces]]
|
|
257
|
+
namespace = "b"
|
|
258
|
+
patterns = ["domains/*/warehouse.sea"]
|
|
259
|
+
EOF
|
|
260
|
+
mkdir -p "$tmpdir/domains/logistics"
|
|
261
|
+
echo 'Entity "Warehouse"' > "$tmpdir/domains/logistics/warehouse.sea"
|
|
262
|
+
|
|
263
|
+
# Test that --fail-on-ambiguity properly detects ambiguous matches
|
|
264
|
+
# The command should fail and output an error message
|
|
265
|
+
set +e # Temporarily disable exit on error
|
|
266
|
+
output=$(./target/debug/domainforge registry resolve --fail-on-ambiguity "$tmpdir/domains/logistics/warehouse.sea" 2>&1)
|
|
267
|
+
exit_code=$?
|
|
268
|
+
set -e # Re-enable exit on error
|
|
269
|
+
|
|
270
|
+
if [ $exit_code -ne 0 ] && echo "$output" | grep -q "multiple namespaces"; then
|
|
271
|
+
echo "✓ Ambiguity detection working correctly"
|
|
272
|
+
echo "Output: $output"
|
|
273
|
+
exit 0
|
|
274
|
+
else
|
|
275
|
+
echo "✗ Expected ambiguity error but got:"
|
|
276
|
+
echo "Exit code: $exit_code"
|
|
277
|
+
echo "Output: $output"
|
|
278
|
+
exit 1
|
|
279
|
+
fi
|
|
280
|
+
|
|
281
|
+
test-wasm:
|
|
282
|
+
name: Test WASM
|
|
283
|
+
needs: lint
|
|
284
|
+
timeout-minutes: 20
|
|
285
|
+
runs-on: ubuntu-latest
|
|
286
|
+
steps:
|
|
287
|
+
- uses: actions/checkout@v6
|
|
288
|
+
|
|
289
|
+
- name: Install Rust toolchain
|
|
290
|
+
uses: dtolnay/rust-toolchain@stable
|
|
291
|
+
with:
|
|
292
|
+
targets: wasm32-unknown-unknown
|
|
293
|
+
|
|
294
|
+
- name: Install just
|
|
295
|
+
uses: extractions/setup-just@v4
|
|
296
|
+
|
|
297
|
+
- name: Cache dependencies
|
|
298
|
+
uses: actions/cache@v5
|
|
299
|
+
with:
|
|
300
|
+
path: |
|
|
301
|
+
~/.cargo/registry/index
|
|
302
|
+
~/.cargo/registry/cache
|
|
303
|
+
~/.cargo/git/db
|
|
304
|
+
key: ${{ runner.os }}-${{ env.CACHE_VERSION }}-wasm-${{ hashFiles('**/Cargo.lock') }}
|
|
305
|
+
restore-keys: |
|
|
306
|
+
${{ runner.os }}-${{ env.CACHE_VERSION }}-wasm-
|
|
307
|
+
|
|
308
|
+
- name: Install wasm-pack
|
|
309
|
+
run: cargo install wasm-pack --locked
|
|
310
|
+
|
|
311
|
+
- name: Build WASM
|
|
312
|
+
run: |
|
|
313
|
+
cd domainforge-core
|
|
314
|
+
wasm-pack build --target web --features wasm
|
|
315
|
+
|
|
316
|
+
- name: Check bundle size
|
|
317
|
+
run: |
|
|
318
|
+
WASM_FILE="domainforge-core/pkg/domainforge_core_bg.wasm"
|
|
319
|
+
python3 scripts/ci_tasks.py check-size --file "$WASM_FILE" --max-bytes "${{ env.WASM_MAX_BYTES }}" --label "WASM bundle"
|
|
320
|
+
|
|
321
|
+
security:
|
|
322
|
+
name: Security Audit
|
|
323
|
+
needs: lint
|
|
324
|
+
timeout-minutes: 10
|
|
325
|
+
runs-on: ubuntu-latest
|
|
326
|
+
steps:
|
|
327
|
+
- uses: actions/checkout@v6
|
|
328
|
+
|
|
329
|
+
- name: Install Rust toolchain
|
|
330
|
+
uses: dtolnay/rust-toolchain@stable
|
|
331
|
+
|
|
332
|
+
- name: Run cargo audit
|
|
333
|
+
uses: rustsec/audit-check@v1
|
|
334
|
+
with:
|
|
335
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
name: Dependabot Auto Merge
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- reopened
|
|
8
|
+
- synchronize
|
|
9
|
+
- labeled
|
|
10
|
+
pull_request_review:
|
|
11
|
+
types:
|
|
12
|
+
- submitted
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: write
|
|
16
|
+
pull-requests: write
|
|
17
|
+
checks: read
|
|
18
|
+
statuses: read
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
auto-merge:
|
|
22
|
+
name: Auto-merge Dependabot PRs
|
|
23
|
+
if: github.actor == 'dependabot[bot]'
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- name: Check out
|
|
28
|
+
uses: actions/checkout@v6
|
|
29
|
+
|
|
30
|
+
- name: Extract Dependabot metadata
|
|
31
|
+
id: dependabot
|
|
32
|
+
uses: dependabot/fetch-metadata@v2
|
|
33
|
+
with:
|
|
34
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
35
|
+
|
|
36
|
+
- name: Safety gate – block major updates
|
|
37
|
+
if: steps.dependabot.outputs.update-type == 'version-update:semver-major'
|
|
38
|
+
run: |
|
|
39
|
+
echo "Major update detected. Auto-merge disabled."
|
|
40
|
+
exit 0
|
|
41
|
+
|
|
42
|
+
- name: Safety gate – ensure all checks pass
|
|
43
|
+
id: check_status
|
|
44
|
+
run: |
|
|
45
|
+
sleep 10
|
|
46
|
+
|
|
47
|
+
checks=$(gh pr checks ${{ github.event.pull_request.number }} --json state,conclusion 2>/dev/null || echo '[]')
|
|
48
|
+
|
|
49
|
+
if [ "$checks" = "[]" ] || [ -z "$checks" ]; then
|
|
50
|
+
echo "No checks found. Cannot verify CI. Failing."
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
failed=$(echo "$checks" | jq -r '.[] | select(.state=="COMPLETED") | select(.conclusion=="FAILURE") | .conclusion' | head -1)
|
|
55
|
+
if [ ! -z "$failed" ]; then
|
|
56
|
+
echo "Some checks failed."
|
|
57
|
+
exit 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
pending=$(echo "$checks" | jq -r '.[] | select(.state=="IN_PROGRESS" or .state=="PENDING" or .state=="QUEUED") | .state' | head -1)
|
|
61
|
+
if [ ! -z "$pending" ]; then
|
|
62
|
+
MAX_WAIT_SECONDS=${MAX_WAIT_SECONDS:-120}
|
|
63
|
+
SLEEP_INTERVAL=${SLEEP_INTERVAL:-15}
|
|
64
|
+
elapsed=0
|
|
65
|
+
while [ $elapsed -lt $MAX_WAIT_SECONDS ]; do
|
|
66
|
+
echo "Checks still pending (${elapsed}s elapsed). Waiting ${SLEEP_INTERVAL}s..."
|
|
67
|
+
sleep $SLEEP_INTERVAL
|
|
68
|
+
elapsed=$((elapsed + SLEEP_INTERVAL))
|
|
69
|
+
checks=$(gh api repos/${{ github.repository }}/commits/${{ github.event.pull_request.head.sha }}/check-runs --jq '.check_runs')
|
|
70
|
+
pending=$(echo "$checks" | jq -r '.[] | select(.state=="IN_PROGRESS" or .state=="PENDING" or .state=="QUEUED") | .state' | head -1)
|
|
71
|
+
if [ -z "$pending" ]; then
|
|
72
|
+
echo "All checks completed."
|
|
73
|
+
break
|
|
74
|
+
fi
|
|
75
|
+
done
|
|
76
|
+
if [ ! -z "$pending" ]; then
|
|
77
|
+
echo "Checks still pending after ${MAX_WAIT_SECONDS}s. Failing."
|
|
78
|
+
exit 1
|
|
79
|
+
fi
|
|
80
|
+
fi
|
|
81
|
+
|
|
82
|
+
echo "All checks passed."
|
|
83
|
+
env:
|
|
84
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
85
|
+
|
|
86
|
+
- name: Approve PR
|
|
87
|
+
run: gh pr review ${{ github.event.pull_request.number }} --approve --body "Auto-approved by workflow."
|
|
88
|
+
env:
|
|
89
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
90
|
+
|
|
91
|
+
- name: Apply auto-merge label (optional)
|
|
92
|
+
run: gh pr edit ${{ github.event.pull_request.number }} --add-label "automerge"
|
|
93
|
+
env:
|
|
94
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
95
|
+
|
|
96
|
+
- name: Auto-merge security updates
|
|
97
|
+
if: steps.dependabot.outputs.update-type == 'security'
|
|
98
|
+
run: gh pr merge ${{ github.event.pull_request.number }} --merge --delete-branch
|
|
99
|
+
env:
|
|
100
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
101
|
+
|
|
102
|
+
- name: Auto-merge patch & minor updates
|
|
103
|
+
if: >
|
|
104
|
+
steps.dependabot.outputs.update-type == 'version-update:semver-patch' ||
|
|
105
|
+
steps.dependabot.outputs.update-type == 'version-update:semver-minor'
|
|
106
|
+
run: gh pr merge ${{ github.event.pull_request.number }} --squash --delete-branch
|
|
107
|
+
env:
|
|
108
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
109
|
+
|
|
110
|
+
- name: Print merge decision
|
|
111
|
+
run: |
|
|
112
|
+
echo "Dependabot PR processed:"
|
|
113
|
+
echo " - Update type: ${{ steps.dependabot.outputs.update-type }}"
|
|
114
|
+
echo " - Auto-merge executed."
|