hecks 3.14.0 → 5.0.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.
- checksums.yaml +4 -4
- data/examples/pizzas/adapters/fake_processor.rb +34 -0
- data/examples/pizzas/adapters/payment_signature.rb +66 -0
- data/examples/pizzas/adapters/payment_webhook.rb +87 -0
- data/examples/pizzas/bluebook/pizzas.behaviors +33 -0
- data/examples/pizzas/bluebook/pizzas.hecksagon +5 -3
- data/examples/pizzas/config.ru +22 -0
- data/exe/hecks +1 -1
- data/lib/hecks/adapters/driven/prism.rb +0 -2
- data/lib/hecks/adapters/driven.rb +0 -2
- data/lib/hecks/adapters/driving/json.rb +9 -16
- data/lib/hecks/bluebook/dsl/bootstrap_table.rb +2 -2
- data/lib/hecks/bluebook/dsl/derivation_words.rb +58 -0
- data/lib/hecks/bluebook/dsl/translation_builder.rb +6 -37
- data/lib/hecks/bluebook/expression/ast_json.rb +0 -9
- data/lib/hecks/bluebook/hecksagon.rb +1 -1
- data/lib/hecks/bluebook/meta_validator/translation_judge/rules.rb +7 -10
- data/lib/hecks/bluebook/meta_validator/translation_judge.rb +4 -8
- data/lib/hecks/bluebook/meta_validator.rb +0 -11
- data/lib/hecks/bluebook/translation.rb +18 -10
- data/lib/hecks/bluebook/translation_expression/evaluator.rb +63 -0
- data/lib/hecks/bluebook/translation_expression/parser.rb +127 -0
- data/lib/hecks/bluebook/translation_expression.rb +39 -0
- data/lib/hecks/bluebook/translation_plan.rb +70 -0
- data/lib/hecks/bluebook.rb +2 -0
- data/lib/hecks/chapters.rb +3 -3
- data/lib/hecks/cli/project_cli/launcher_source.rb +1 -1
- data/lib/hecks/composer/adapters/claude_composer.adapter +3 -0
- data/lib/hecks/composer/adapters/claude_composer.rb +83 -0
- data/lib/hecks/composer/adapters/fake_agent.adapter +3 -0
- data/lib/hecks/composer/adapters/fake_agent.rb +55 -0
- data/lib/hecks/composer/adapters/jev.adapter +3 -0
- data/lib/hecks/composer/adapters/jev.rb +66 -0
- data/lib/hecks/composer/agent.rb +113 -0
- data/lib/hecks/composer/assistant.rb +110 -0
- data/lib/hecks/composer/behavior_run.rb +53 -0
- data/lib/hecks/composer/bluebook/composer.bluebook +178 -0
- data/lib/hecks/composer/bluebook/composer.hecksagon +16 -0
- data/lib/hecks/composer/board.rb +65 -0
- data/lib/hecks/composer/board_edit/command_text.rb +39 -0
- data/lib/hecks/composer/board_edit/source.rb +84 -0
- data/lib/hecks/composer/board_edit.rb +144 -0
- data/lib/hecks/composer/check.rb +89 -0
- data/lib/hecks/composer/domains.rb +81 -0
- data/lib/hecks/composer/jobs.rb +134 -0
- data/lib/hecks/composer/layout.rb +37 -0
- data/lib/hecks/composer/live.rb +150 -0
- data/lib/hecks/composer/outline.rb +48 -0
- data/lib/hecks/composer/page.html +989 -0
- data/lib/hecks/composer/panels.rb +142 -0
- data/lib/hecks/composer/parse.rb +83 -0
- data/lib/hecks/composer/plain.rb +28 -0
- data/lib/hecks/composer/ports/composer_agent.port +7 -0
- data/lib/hecks/composer/session.rb +141 -0
- data/lib/hecks/composer/toolbox.rb +166 -0
- data/lib/hecks/composer/web.rb +156 -0
- data/lib/hecks/composer/workbench.rb +51 -0
- data/lib/hecks/composer/workspace.rb +81 -0
- data/lib/hecks/composer.rb +17 -0
- data/lib/hecks/corpus/adapters.rb +22 -0
- data/lib/hecks/corpus/rust.rb +1 -1
- data/lib/hecks/corpus/worlds.rb +19 -0
- data/lib/hecks/corpus.rb +5 -0
- data/lib/hecks/forms/app/commands.rb +2 -3
- data/lib/hecks/forms/app/queries.rb +2 -3
- data/lib/hecks/forms/app/records.rb +17 -5
- data/lib/hecks/forms/app/responses.rb +3 -1
- data/lib/hecks/forms/command_form_renderer.rb +42 -16
- data/lib/hecks/forms/field_controls.rb +2 -2
- data/lib/hecks/forms/field_renderer.rb +1 -1
- data/lib/hecks/forms/field_shape.rb +36 -17
- data/lib/hecks/forms/index_renderer.rb +2 -1
- data/lib/hecks/forms/page.rb +1 -1
- data/lib/hecks/forms/params.rb +0 -13
- data/lib/hecks/forms/query_form_renderer.rb +7 -6
- data/lib/hecks/forms/record_renderer.rb +11 -7
- data/lib/hecks/forms/rule_words.rb +100 -0
- data/lib/hecks/forms/value_object_shape.rb +2 -1
- data/lib/hecks/fuzzing/bounded_exhaustive_expressions.rb +0 -3
- data/lib/hecks/fuzzing/isolated_boot/worlds.rb +3 -6
- data/lib/hecks/fuzzing/replay/filters.rb +2 -6
- data/lib/hecks/gate/stages.yml +25 -0
- data/lib/hecks/grammar/evolve/seeds.rb +0 -6
- data/lib/hecks/grammar/evolve.rb +0 -3
- data/lib/hecks/grammar/translation.bluebook +1 -1
- data/lib/hecks/hecks/adapters/codebase/composing.rb +56 -0
- data/lib/hecks/hecks/adapters/codebase/source_tree.rb +3 -1
- data/lib/hecks/hecks/adapters/first_admin.rb +3 -3
- data/lib/hecks/hecks/adapters/journal_store/changes.rb +0 -26
- data/lib/hecks/hecks/adapters/journal_store/examination.rb +2 -23
- data/lib/hecks/hecks/adapters/journal_store/readings.rb +3 -11
- data/lib/hecks/hecks/adapters/journal_store.rb +0 -11
- data/lib/hecks/hecks/adapters/rehearsal/inquiry.rb +4 -11
- data/lib/hecks/hecks/adapters/rehearsal/memory_store.rb +0 -9
- data/lib/hecks/hecks/adapters/rehearsal/postgres_reading.rb +0 -4
- data/lib/hecks/hecks/codebase.behaviors +6 -0
- data/lib/hecks/hecks/codebase.bluebook +21 -0
- data/lib/hecks/hecks/composer.behaviors +68 -0
- data/lib/hecks/hecks/context_map.hecksagon +1 -1
- data/lib/hecks/hecks/custodian.behaviors +0 -6
- data/lib/hecks/hecks/custodian.bluebook +3 -80
- data/lib/hecks/hecks/hecks.hecksagon +2 -2
- data/lib/hecks/hecks/hecks.world +1 -1
- data/lib/hecks/hecks/rehearsal.bluebook +7 -13
- data/lib/hecks/kernel_capabilities/templates.rb +4 -4
- data/lib/hecks/kernel_capabilities.rb +1 -1
- data/lib/hecks/language/bluebook/vocabulary.bluebook +2 -3
- data/lib/hecks/language/translation/translation_aggregate.bluebook +21 -24
- data/lib/hecks/ports/access_control.rb +2 -2
- data/lib/hecks/ports/persistence/plugins/era/era_check.rb +3 -41
- data/lib/hecks/ports/persistence/plugins/era/lineage/coverage.rb +7 -7
- data/lib/hecks/ports/persistence/plugins/era/lineage/rewrite.rb +25 -2
- data/lib/hecks/ports/persistence/plugins/era/lineage/rules.rb +4 -4
- data/lib/hecks/ports/persistence/plugins/era/lineage.rb +17 -25
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/base_sql.rb +0 -12
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/domain_rename.rb +1 -1
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/era_store.rb +2 -22
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/provisioning.rb +0 -1
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage.rb +9 -3
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/minter.rb +3 -29
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/refusals.rb +2 -26
- data/lib/hecks/ports/persistence/plugins/era/translation/audit/layer_two.rb +6 -33
- data/lib/hecks/ports/persistence/plugins/era/translation/audit/unfed_report.rb +3 -3
- data/lib/hecks/ports/persistence/plugins/era/translation/audit.rb +2 -4
- data/lib/hecks/ports/persistence/plugins/era/translation/expression_sql.rb +52 -0
- data/lib/hecks/ports/persistence/plugins/era/translation/rule_compiler.rb +23 -29
- data/lib/hecks/ports/persistence/plugins/era/translation/scaffold.rb +1 -1
- data/lib/hecks/ports/persistence/plugins/era/translation.rb +0 -1
- data/lib/hecks/ports/persistence/plugins/era.rb +3 -6
- data/lib/hecks/ports.rb +0 -1
- data/lib/hecks/projection_files.rb +3 -1
- data/lib/hecks/projections/deploy/templates/lambda/nat_comment_oauth.tmpl +1 -1
- data/lib/hecks/projections/glossary/entries.rb +10 -4
- data/lib/hecks/projections/glossary/groups.rb +42 -0
- data/lib/hecks/projections/glossary/html/page.rb +7 -2
- data/lib/hecks/projections/glossary/html/parser.rb +1 -1
- data/lib/hecks/projections/glossary/html/sections.rb +31 -11
- data/lib/hecks/projections/glossary/html.rb +1 -2
- data/lib/hecks/projections/glossary/markdown.rb +31 -28
- data/lib/hecks/projections/glossary/mermaid.rb +3 -0
- data/lib/hecks/projections/glossary/page.css +143 -153
- data/lib/hecks/projections/glossary/page.js +63 -3
- data/lib/hecks/projections/glossary/sentences/actions.rb +88 -0
- data/lib/hecks/projections/glossary/sentences/paths.rb +77 -0
- data/lib/hecks/projections/glossary/sentences/queries.rb +90 -0
- data/lib/hecks/projections/glossary/sentences/value_objects.rb +32 -5
- data/lib/hecks/projections/glossary/sentences.rb +13 -3
- data/lib/hecks/projections/glossary/slugs.rb +4 -1
- data/lib/hecks/projections/glossary.rb +2 -1
- data/lib/hecks/projections/plain_english.rb +97 -0
- data/lib/hecks/projections/rust_vocabulary/arguments.rb +2 -2
- data/lib/hecks/projections/rust_vocabulary/enum_body.rb +20 -25
- data/lib/hecks/projections/rust_vocabulary/tests.rb +2 -2
- data/lib/hecks/projections/rust_vocabulary.rb +14 -6
- data/lib/hecks/projections/site/cms_editor/color.rb +0 -6
- data/lib/hecks/projections/site/cms_editor/templates/src/host.ts.tmpl +7 -2
- data/lib/hecks/projections/statements/actions.rb +99 -0
- data/lib/hecks/projections/statements/relationships.rb +86 -0
- data/lib/hecks/projections/statements.rb +15 -24
- data/lib/hecks/projector/exporter/adapters.rb +112 -0
- data/lib/hecks/projector/exporter/translations.rb +18 -35
- data/lib/hecks/projector/exporter/worlds.rb +103 -0
- data/lib/hecks/projector/exporter.rb +5 -1
- data/lib/hecks/quality_control/adapters/agent.rb +6 -7
- data/lib/hecks/quality_control/adapters/agent_profile.rb +16 -114
- data/lib/hecks/quality_control/cli/qa_mine_combinations.rb +1 -1
- data/lib/hecks/runtime/loader/boot_steps.rb +0 -20
- data/lib/hecks/runtime/outbox.rb +2 -9
- data/lib/hecks/runtime/port_operation_interpreter.rb +1 -9
- data/lib/hecks/runtime/remote_dispatcher.rb +2 -2
- data/lib/hecks/runtime/value/unwrapping.rb +60 -0
- data/lib/hecks/runtime/value.rb +10 -21
- data/lib/hecks/rust_build/project_rust/target_ir.rb +23 -4
- data/lib/hecks/rust_build/wasm.rb +0 -12
- data/lib/hecks/rust_build/write_if_changed.rb +12 -12
- data/lib/hecks/rust_format.rb +77 -0
- data/lib/hecks/tools/fuzz_sweep/findings.rb +3 -9
- data/lib/hecks/tools/fuzz_sweep.rb +1 -3
- data/lib/hecks/tools/translation_audit/verdicts.rb +3 -28
- data/lib/hecks/tools/translation_audit.rb +8 -10
- data/lib/hecks/tools/translation_scaffold/reporting.rb +1 -1
- data/lib/hecks/version.rb +1 -1
- data/lib/hecks/vocabulary.rb +2 -1
- data/lib/hecks.rb +3 -0
- data/prebuilt/{1a6f596be124228be93eba1d86dbc9d2933190fa389b284331241cb9f27115a0.marshal → ad68f9e06c8068c2a4176b57abf3083d591d5d8980c2b3e897b97331f965b643.marshal} +0 -0
- data/prebuilt/{a883a7e568667aa5ac904c82daff356bdf9e996252a36af6def4a4a43efb967e.marshal → ee22ec8642c4006717ba2b80f46e5efb81de459eef9dfec043e838c0ad4fd720.marshal} +0 -0
- data/prebuilt/{verdicts-872993b1aa26d73fe48f28251374b8585fed145d02aab42be0f00de386b6ff80.json → verdicts-b69f5dcbba79c20daa0493476fa7c317004a30aa2bc3d3dc6a722ea70ae2b43b.json} +1 -1
- data/rust/Cargo.toml +40 -0
- data/rust/build/Cargo.toml +36 -0
- data/rust/build/clippy.toml +4 -0
- data/rust/build/src/adapters_pass.rs +196 -0
- data/rust/build/src/binding_pass.rs +54 -13
- data/rust/build/src/build_artifact.rs +23 -5
- data/rust/build/src/cargo_sync.rs +69 -26
- data/rust/build/src/lineage_pass.rs +101 -87
- data/rust/build/src/main.rs +11 -2
- data/rust/build/src/pipeline.rs +80 -19
- data/rust/build/src/reserved_names.rs +6 -50
- data/rust/build/src/resolve.rs +82 -35
- data/rust/build/src/rustfmt.rs +100 -0
- data/rust/build/src/seams_pass.rs +85 -16
- data/rust/build/src/subprocess.rs +30 -6
- data/rust/build/src/tmp.rs +5 -2
- data/rust/build/src/translation_pass.rs +72 -22
- data/rust/build/src/world_pass.rs +109 -0
- data/rust/clippy.toml +4 -0
- data/rust/codegen/Cargo.toml +36 -0
- data/rust/codegen/clippy.toml +4 -0
- data/rust/codegen/src/asks.rs +40 -14
- data/rust/codegen/src/attr.rs +2 -2
- data/rust/codegen/src/bridging.rs +676 -117
- data/rust/codegen/src/commands.rs +979 -373
- data/rust/codegen/src/constraints.rs +88 -25
- data/rust/codegen/src/dependency_planning.rs +128 -34
- data/rust/codegen/src/domain_generator.rs +306 -170
- data/rust/codegen/src/exemplar.rs +87 -32
- data/rust/codegen/src/expr_emitter.rs +54 -6
- data/rust/codegen/src/fielded.rs +193 -41
- data/rust/codegen/src/hecks_naming.rs +124 -16
- data/rust/codegen/src/hecks_naming_tests.rs +81 -0
- data/rust/codegen/src/json.rs +80 -44
- data/rust/codegen/src/json_codec.rs +585 -149
- data/rust/codegen/src/literal.rs +104 -138
- data/rust/codegen/src/main.rs +151 -52
- data/rust/codegen/src/manifest.rs +76 -14
- data/rust/codegen/src/mutations.rs +1212 -239
- data/rust/codegen/src/naming.rs +111 -60
- data/rust/codegen/src/optional_pass.rs +90 -28
- data/rust/codegen/src/ports.rs +5 -4
- data/rust/codegen/src/prelude.rs +139 -49
- data/rust/codegen/src/presenters.rs +335 -0
- data/rust/codegen/src/queries.rs +601 -226
- data/rust/codegen/src/reactions.rs +268 -74
- data/rust/codegen/src/read_models.rs +574 -229
- data/rust/codegen/src/reference_specs.rs +16 -3
- data/rust/codegen/src/registry.rs +128 -79
- data/rust/codegen/src/reserved_names.rs +6 -50
- data/rust/codegen/src/shared.rs +71 -22
- data/rust/codegen/src/sidecars.rs +15 -5
- data/rust/codegen/src/skip_reason.rs +8 -2
- data/rust/codegen/src/types.rs +306 -108
- data/rust/host/Cargo.lock +1 -0
- data/rust/host/Cargo.toml +40 -4
- data/rust/host/HECKS_RELEASE +1 -1
- data/rust/host/clippy.toml +4 -0
- data/rust/host/src/api.rs +698 -218
- data/rust/host/src/auth.rs +491 -214
- data/rust/host/src/b64.rs +91 -0
- data/rust/host/src/bin/expr_harness.rs +6 -2
- data/rust/host/src/bin/lineage_harness.rs +47 -11
- data/rust/host/src/bin/mint_harness.rs +70 -37
- data/rust/host/src/bin/validate_harness.rs +16 -8
- data/rust/host/src/boot.rs +144 -68
- data/rust/host/src/boundary_fuzz/api.rs +130 -32
- data/rust/host/src/boundary_fuzz/auth.rs +108 -23
- data/rust/host/src/boundary_fuzz/expr_json.rs +85 -11
- data/rust/host/src/boundary_fuzz/ir.rs +164 -12
- data/rust/host/src/boundary_fuzz/server.rs +283 -36
- data/rust/host/src/boundary_fuzz/web.rs +56 -8
- data/rust/host/src/checkout.rs +78 -32
- data/rust/host/src/clock.rs +8 -0
- data/rust/host/src/commerce_ir.rs +333 -95
- data/rust/host/src/crypto.rs +33 -0
- data/rust/host/src/dispatch.rs +1037 -331
- data/rust/host/src/expr_json.rs +1021 -273
- data/rust/host/src/extension.rs +24 -4
- data/rust/host/src/field_hints.rs +11 -7
- data/rust/host/src/fuzz_support.rs +85 -13
- data/rust/host/src/host.rs +100 -0
- data/rust/host/src/http.rs +22 -0
- data/rust/host/src/ir.rs +326 -16
- data/rust/host/src/journal.rs +277 -176
- data/rust/host/src/lambda_client.rs +219 -53
- data/rust/host/src/lib.rs +16 -4
- data/rust/host/src/log.rs +62 -11
- data/rust/host/src/mint.rs +1153 -326
- data/rust/host/src/needs.rs +185 -44
- data/rust/host/src/payments/keystore.rs +197 -45
- data/rust/host/src/payments/roles.rs +39 -7
- data/rust/host/src/payments/tests.rs +1427 -282
- data/rust/host/src/payments.rs +391 -112
- data/rust/host/src/platform_signin/attack_tests.rs +5 -5
- data/rust/host/src/platform_signin/config.rs +11 -11
- data/rust/host/src/platform_signin/cookie.rs +2 -2
- data/rust/host/src/platform_signin/extension.rs +2 -1
- data/rust/host/src/platform_signin/handler.rs +9 -8
- data/rust/host/src/platform_signin/jti.rs +4 -2
- data/rust/host/src/platform_signin/jwks.rs +2 -1
- data/rust/host/src/platform_signin/jws.rs +2 -37
- data/rust/host/src/platform_signin/known_answer_tests.rs +5 -1
- data/rust/host/src/platform_signin/mode_tests.rs +5 -3
- data/rust/host/src/platform_signin/pages.rs +20 -20
- data/rust/host/src/platform_signin/session.rs +8 -1
- data/rust/host/src/platform_signin/settings.rs +6 -6
- data/rust/host/src/platform_signin/strict_json.rs +12 -9
- data/rust/host/src/platform_signin/verify.rs +41 -41
- data/rust/host/src/platform_signin/wiring_support.rs +13 -18
- data/rust/host/src/presentation.rs +207 -63
- data/rust/host/src/presentation_write.rs +502 -187
- data/rust/host/src/query_step.rs +69 -18
- data/rust/host/src/rate_limit.rs +541 -142
- data/rust/host/src/reference_transform.rs +77 -25
- data/rust/host/src/reference_validate.rs +443 -104
- data/rust/host/src/resend.rs +190 -55
- data/rust/host/src/secrets.rs +116 -21
- data/rust/host/src/server.rs +555 -104
- data/rust/host/src/storage_shape.rs +88 -21
- data/rust/host/src/test_pg.rs +17 -7
- data/rust/host/src/ui_schema.rs +495 -207
- data/rust/host/src/wasm_runner.rs +21 -6
- data/rust/host/src/web/commerce.rs +101 -23
- data/rust/host/src/web/newsletter/cooldown.rs +10 -3
- data/rust/host/src/web/newsletter/template.rs +26 -7
- data/rust/host/src/web/newsletter/tests.rs +112 -23
- data/rust/host/src/web/newsletter.rs +209 -59
- data/rust/host/src/web/newsletter_send.rs +251 -79
- data/rust/host/src/web/registration_receipt/tests.rs +16 -4
- data/rust/host/src/web/registration_receipt.rs +100 -24
- data/rust/host/src/web/registrations.rs +1384 -332
- data/rust/host/src/web/resend_webhook.rs +138 -80
- data/rust/host/src/web.rs +2416 -508
- data/rust/lsp/Cargo.toml +36 -0
- data/rust/lsp/clippy.toml +4 -0
- data/rust/lsp/src/json.rs +29 -22
- data/rust/lsp/src/main.rs +81 -31
- data/rust/lsp/src/outline.rs +23 -7
- data/rust/lsp/src/rpc.rs +17 -4
- data/rust/parser/Cargo.toml +36 -0
- data/rust/parser/clippy.toml +4 -0
- data/rust/parser/src/build/closed_sets.rs +6 -1
- data/rust/parser/src/build/identity.rs +4 -3
- data/rust/parser/src/build/mod.rs +1 -1
- data/rust/parser/src/build/named_pattern.rs +4 -1
- data/rust/parser/src/build/naming.rs +2 -80
- data/rust/parser/src/build/pattern_subset.rs +6 -8
- data/rust/parser/src/build/query_derive.rs +3 -1
- data/rust/parser/src/build/query_inference.rs +14 -5
- data/rust/parser/src/build/read_model.rs +4 -1
- data/rust/parser/src/build/references.rs +4 -3
- data/rust/parser/src/canonical.rs +34 -15
- data/rust/parser/src/emit.rs +187 -105
- data/rust/parser/src/expr/ast_json.rs +134 -42
- data/rust/parser/src/expr/evaluator.rs +27 -9
- data/rust/parser/src/expr/mod.rs +54 -13
- data/rust/parser/src/expr/resolver.rs +299 -92
- data/rust/parser/src/ir.rs +35 -3
- data/rust/parser/src/keywords.rs +7168 -516
- data/rust/parser/src/lex.rs +11 -25
- data/rust/parser/src/lib.rs +1 -0
- data/rust/parser/src/main.rs +65 -6
- data/rust/parser/src/parse/adapter.rs +157 -0
- data/rust/parser/src/parse/aggregate.rs +19 -10
- data/rust/parser/src/parse/chapter.rs +16 -17
- data/rust/parser/src/parse/command.rs +35 -16
- data/rust/parser/src/parse/domain_port.rs +4 -7
- data/rust/parser/src/parse/entity.rs +21 -11
- data/rust/parser/src/parse/hecksagon.rs +10 -4
- data/rust/parser/src/parse/lifecycle.rs +9 -5
- data/rust/parser/src/parse/mod.rs +22 -91
- data/rust/parser/src/parse/needs.rs +21 -12
- data/rust/parser/src/parse/policy.rs +2 -2
- data/rust/parser/src/parse/process_manager.rs +9 -11
- data/rust/parser/src/parse/query.rs +8 -4
- data/rust/parser/src/parse/read_model.rs +57 -16
- data/rust/parser/src/parse/value_object.rs +7 -2
- data/rust/parser/src/parse/world.rs +322 -0
- data/rust/parser/src/ruby_value.rs +7 -6
- data/rust/src/exemplar/json.rs +4 -4
- data/rust/src/exemplar/mutations.rs +18 -0
- data/rust/src/exemplar/read_models.rs +1 -10
- data/rust/src/kernel/attribute_shapes/composite.rs +54 -14
- data/rust/src/kernel/attribute_shapes/list.rs +2 -2
- data/rust/src/kernel/attribute_shapes/mod.rs +8 -8
- data/rust/src/kernel/attribute_shapes/scalar.rs +2 -2
- data/rust/src/kernel/cli.rs +244 -114
- data/rust/src/kernel/dispatch.rs +323 -115
- data/rust/src/kernel/dispatch_guard_tests.rs +327 -65
- data/rust/src/kernel/expr.rs +203 -86
- data/rust/src/kernel/expression_operators/arithmetic.rs +138 -25
- data/rust/src/kernel/expression_operators/comparison.rs +87 -2
- data/rust/src/kernel/expression_operators/enumeration.rs +106 -22
- data/rust/src/kernel/expression_operators/logical.rs +9 -3
- data/rust/src/kernel/expression_operators/membership.rs +3 -1
- data/rust/src/kernel/expression_operators/mod.rs +34 -21
- data/rust/src/kernel/expression_operators/pattern_match.rs +46 -11
- data/rust/src/kernel/expression_operators/positional.rs +84 -30
- data/rust/src/kernel/expression_operators/presence.rs +52 -13
- data/rust/src/kernel/expression_operators/sign_test.rs +3 -1
- data/rust/src/kernel/expression_operators/sized.rs +24 -8
- data/rust/src/kernel/expression_operators/text.rs +120 -27
- data/rust/src/kernel/expression_operators/to_string.rs +10 -4
- data/rust/src/kernel/json.rs +244 -148
- data/rust/src/kernel/mod.rs +47 -33
- data/rust/src/kernel/named_query.rs +63 -15
- data/rust/src/kernel/needs.rs +112 -25
- data/rust/src/kernel/orchestrate.rs +980 -581
- data/rust/src/kernel/orchestrate_guard_tests.rs +538 -140
- data/rust/src/kernel/pattern.rs +107 -34
- data/rust/src/kernel/present.rs +261 -0
- data/rust/src/kernel/query_comparators.rs +118 -41
- data/rust/src/kernel/query_ordering.rs +13 -5
- data/rust/src/kernel/read_model.rs +479 -181
- data/rust/src/kernel/reference_lookup.rs +122 -26
- data/rust/src/kernel/repository.rs +293 -66
- data/rust/src/kernel/routing.rs +58 -42
- data/rust/src/kernel/ruby_float.rs +139 -0
- data/rust/src/kernel/vocab/aggregate_dispatch_order.rs +57 -57
- data/rust/src/kernel/vocab/entity_dispatch_order.rs +54 -54
- data/rust/src/kernel/vocab/field_hint.rs +19 -25
- data/rust/src/kernel/vocab/mod.rs +6 -6
- data/rust/src/kernel/vocab/query_comparator.rs +23 -24
- data/rust/src/kernel/vocab/refusal_template.rs +501 -297
- data/rust/src/lib.rs +50 -0
- data/rust/src/main.rs +4 -1
- data/rust/web/Cargo.toml +36 -0
- data/rust/web/clippy.toml +4 -0
- metadata +85 -15
- data/examples/pizzas/bluebook/hecksagon/mock_stripe_payment_adapter.rb +0 -36
- data/lib/hecks/adapters/driven/google_authentication.adapter +0 -3
- data/lib/hecks/adapters/driven/google_authentication.rb +0 -99
- data/lib/hecks/adapters/driven/mock_stripe_adapter.adapter +0 -3
- data/lib/hecks/adapters/driven/mock_stripe_adapter.rb +0 -32
- data/lib/hecks/ports/authentication.port +0 -6
- data/lib/hecks/ports/authentication.rb +0 -67
- data/lib/hecks/ports/persistence/plugins/era/translation/approval_file.rb +0 -255
- data/lib/hecks/ports/persistence/plugins/era/translation/audit/approval_digest.rb +0 -22
- data/rust/host/src/approval.rs +0 -652
|
@@ -55,221 +55,221 @@ pub enum RefusalSite {
|
|
|
55
55
|
|
|
56
56
|
impl RefusalSite {
|
|
57
57
|
/// Every row, in declared order.
|
|
58
|
-
pub const ALL: &'static [
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
58
|
+
pub const ALL: &'static [Self] = &[
|
|
59
|
+
Self::NotFoundCreatingNoIdentity,
|
|
60
|
+
Self::AlreadyExistsCreatingDuplicate,
|
|
61
|
+
Self::AlreadyExistsEntityDuplicate,
|
|
62
|
+
Self::NotFoundActingNoIdentity,
|
|
63
|
+
Self::NotFoundRecordMissing,
|
|
64
|
+
Self::NotFoundEntityParentNoIdentity,
|
|
65
|
+
Self::UnknownVerbEntityUnknown,
|
|
66
|
+
Self::NotFoundEntityElementNoIdentity,
|
|
67
|
+
Self::NotFoundEntityElementMissing,
|
|
68
|
+
Self::NotFoundReferenceTargetMissing,
|
|
69
|
+
Self::NotFoundReadModelReferenceMissing,
|
|
70
|
+
Self::TypeMismatchReadModelObjectReference,
|
|
71
|
+
Self::UnknownVerbNoQuery,
|
|
72
|
+
Self::UnknownVerbEntityQueryMissing,
|
|
73
|
+
Self::UnknownVerbEntityHoldsNoList,
|
|
74
|
+
Self::UnknownVerbEntityNoCommand,
|
|
75
|
+
Self::UnknownVerbAggregateNoCommand,
|
|
76
|
+
Self::UnknownVerbPortNoOperation,
|
|
77
|
+
Self::UnknownVerbNoDomain,
|
|
78
|
+
Self::UnknownVerbNoReadModel,
|
|
79
|
+
Self::UnknownVerbNotFullyQualified,
|
|
80
|
+
Self::UnknownVerbNoAggregate,
|
|
81
|
+
Self::LifecycleRefusedTransitionBlocked,
|
|
82
|
+
Self::TypeMismatchValueObjectShape,
|
|
83
|
+
Self::TypeMismatchReferenceWrongShape,
|
|
84
|
+
Self::TypeMismatchMultiFieldScalar,
|
|
85
|
+
Self::TypeMismatchCompositeIdentity,
|
|
86
|
+
Self::TypeMismatchNumericField,
|
|
87
|
+
Self::TypeMismatchNonFiniteField,
|
|
88
|
+
Self::TypeMismatchIntegerRange,
|
|
89
|
+
Self::TypeMismatchPatternMismatch,
|
|
90
|
+
Self::TypeMismatchArithmeticAmount,
|
|
91
|
+
Self::TypeMismatchArithmeticCurrent,
|
|
92
|
+
Self::TypeMismatchArithmeticSharedField,
|
|
93
|
+
Self::UnknownArgumentUnknownArgs,
|
|
94
|
+
Self::AbsentArgumentAbsentArgs,
|
|
95
|
+
Self::InvariantViolationClosedSetMember,
|
|
96
|
+
Self::InvariantViolationValueObjectInvariant,
|
|
97
|
+
Self::InvariantViolationAdmitsDeclaredSet,
|
|
98
|
+
Self::InvariantViolationUndeclaredSet,
|
|
99
|
+
Self::InvariantViolationGroupByCollision,
|
|
100
|
+
Self::UnauthorizedTenantRequired,
|
|
101
|
+
Self::UnauthorizedRoleMismatch,
|
|
102
|
+
Self::UnauthorizedCrossTenantReference,
|
|
103
|
+
Self::AttributeAbsentAbsentRead,
|
|
104
|
+
Self::ProjectionAbsentAbsentRead,
|
|
105
105
|
];
|
|
106
106
|
|
|
107
107
|
/// The row's declared `refusal`.
|
|
108
|
-
pub fn refusal_class(&self) -> &'static str {
|
|
108
|
+
pub const fn refusal_class(&self) -> &'static str {
|
|
109
109
|
match self {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
110
|
+
Self::NotFoundCreatingNoIdentity => "NotFound",
|
|
111
|
+
Self::AlreadyExistsCreatingDuplicate => "AlreadyExists",
|
|
112
|
+
Self::AlreadyExistsEntityDuplicate => "AlreadyExists",
|
|
113
|
+
Self::NotFoundActingNoIdentity => "NotFound",
|
|
114
|
+
Self::NotFoundRecordMissing => "NotFound",
|
|
115
|
+
Self::NotFoundEntityParentNoIdentity => "NotFound",
|
|
116
|
+
Self::UnknownVerbEntityUnknown => "UnknownVerb",
|
|
117
|
+
Self::NotFoundEntityElementNoIdentity => "NotFound",
|
|
118
|
+
Self::NotFoundEntityElementMissing => "NotFound",
|
|
119
|
+
Self::NotFoundReferenceTargetMissing => "NotFound",
|
|
120
|
+
Self::NotFoundReadModelReferenceMissing => "NotFound",
|
|
121
|
+
Self::TypeMismatchReadModelObjectReference => "TypeMismatch",
|
|
122
|
+
Self::UnknownVerbNoQuery => "UnknownVerb",
|
|
123
|
+
Self::UnknownVerbEntityQueryMissing => "UnknownVerb",
|
|
124
|
+
Self::UnknownVerbEntityHoldsNoList => "UnknownVerb",
|
|
125
|
+
Self::UnknownVerbEntityNoCommand => "UnknownVerb",
|
|
126
|
+
Self::UnknownVerbAggregateNoCommand => "UnknownVerb",
|
|
127
|
+
Self::UnknownVerbPortNoOperation => "UnknownVerb",
|
|
128
|
+
Self::UnknownVerbNoDomain => "UnknownVerb",
|
|
129
|
+
Self::UnknownVerbNoReadModel => "UnknownVerb",
|
|
130
|
+
Self::UnknownVerbNotFullyQualified => "UnknownVerb",
|
|
131
|
+
Self::UnknownVerbNoAggregate => "UnknownVerb",
|
|
132
|
+
Self::LifecycleRefusedTransitionBlocked => "LifecycleRefused",
|
|
133
|
+
Self::TypeMismatchValueObjectShape => "TypeMismatch",
|
|
134
|
+
Self::TypeMismatchReferenceWrongShape => "TypeMismatch",
|
|
135
|
+
Self::TypeMismatchMultiFieldScalar => "TypeMismatch",
|
|
136
|
+
Self::TypeMismatchCompositeIdentity => "TypeMismatch",
|
|
137
|
+
Self::TypeMismatchNumericField => "TypeMismatch",
|
|
138
|
+
Self::TypeMismatchNonFiniteField => "TypeMismatch",
|
|
139
|
+
Self::TypeMismatchIntegerRange => "TypeMismatch",
|
|
140
|
+
Self::TypeMismatchPatternMismatch => "TypeMismatch",
|
|
141
|
+
Self::TypeMismatchArithmeticAmount => "TypeMismatch",
|
|
142
|
+
Self::TypeMismatchArithmeticCurrent => "TypeMismatch",
|
|
143
|
+
Self::TypeMismatchArithmeticSharedField => "TypeMismatch",
|
|
144
|
+
Self::UnknownArgumentUnknownArgs => "UnknownArgument",
|
|
145
|
+
Self::AbsentArgumentAbsentArgs => "AbsentArgument",
|
|
146
|
+
Self::InvariantViolationClosedSetMember => "InvariantViolation",
|
|
147
|
+
Self::InvariantViolationValueObjectInvariant => "InvariantViolation",
|
|
148
|
+
Self::InvariantViolationAdmitsDeclaredSet => "InvariantViolation",
|
|
149
|
+
Self::InvariantViolationUndeclaredSet => "InvariantViolation",
|
|
150
|
+
Self::InvariantViolationGroupByCollision => "InvariantViolation",
|
|
151
|
+
Self::UnauthorizedTenantRequired => "Unauthorized",
|
|
152
|
+
Self::UnauthorizedRoleMismatch => "Unauthorized",
|
|
153
|
+
Self::UnauthorizedCrossTenantReference => "Unauthorized",
|
|
154
|
+
Self::AttributeAbsentAbsentRead => "AttributeAbsent",
|
|
155
|
+
Self::ProjectionAbsentAbsentRead => "ProjectionAbsent",
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
/// The row's declared `site`.
|
|
160
|
-
pub fn site(&self) -> &'static str {
|
|
160
|
+
pub const fn site(&self) -> &'static str {
|
|
161
161
|
match self {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
162
|
+
Self::NotFoundCreatingNoIdentity => "creating_no_identity",
|
|
163
|
+
Self::AlreadyExistsCreatingDuplicate => "creating_duplicate",
|
|
164
|
+
Self::AlreadyExistsEntityDuplicate => "entity_duplicate",
|
|
165
|
+
Self::NotFoundActingNoIdentity => "acting_no_identity",
|
|
166
|
+
Self::NotFoundRecordMissing => "record_missing",
|
|
167
|
+
Self::NotFoundEntityParentNoIdentity => "entity_parent_no_identity",
|
|
168
|
+
Self::UnknownVerbEntityUnknown => "entity_unknown",
|
|
169
|
+
Self::NotFoundEntityElementNoIdentity => "entity_element_no_identity",
|
|
170
|
+
Self::NotFoundEntityElementMissing => "entity_element_missing",
|
|
171
|
+
Self::NotFoundReferenceTargetMissing => "reference_target_missing",
|
|
172
|
+
Self::NotFoundReadModelReferenceMissing => "read_model_reference_missing",
|
|
173
|
+
Self::TypeMismatchReadModelObjectReference => "read_model_object_reference",
|
|
174
|
+
Self::UnknownVerbNoQuery => "no_query",
|
|
175
|
+
Self::UnknownVerbEntityQueryMissing => "entity_query_missing",
|
|
176
|
+
Self::UnknownVerbEntityHoldsNoList => "entity_holds_no_list",
|
|
177
|
+
Self::UnknownVerbEntityNoCommand => "entity_no_command",
|
|
178
|
+
Self::UnknownVerbAggregateNoCommand => "aggregate_no_command",
|
|
179
|
+
Self::UnknownVerbPortNoOperation => "port_no_operation",
|
|
180
|
+
Self::UnknownVerbNoDomain => "no_domain",
|
|
181
|
+
Self::UnknownVerbNoReadModel => "no_read_model",
|
|
182
|
+
Self::UnknownVerbNotFullyQualified => "not_fully_qualified",
|
|
183
|
+
Self::UnknownVerbNoAggregate => "no_aggregate",
|
|
184
|
+
Self::LifecycleRefusedTransitionBlocked => "transition_blocked",
|
|
185
|
+
Self::TypeMismatchValueObjectShape => "value_object_shape",
|
|
186
|
+
Self::TypeMismatchReferenceWrongShape => "reference_wrong_shape",
|
|
187
|
+
Self::TypeMismatchMultiFieldScalar => "multi_field_scalar",
|
|
188
|
+
Self::TypeMismatchCompositeIdentity => "composite_identity",
|
|
189
|
+
Self::TypeMismatchNumericField => "numeric_field",
|
|
190
|
+
Self::TypeMismatchNonFiniteField => "non_finite_field",
|
|
191
|
+
Self::TypeMismatchIntegerRange => "integer_range",
|
|
192
|
+
Self::TypeMismatchPatternMismatch => "pattern_mismatch",
|
|
193
|
+
Self::TypeMismatchArithmeticAmount => "arithmetic_amount",
|
|
194
|
+
Self::TypeMismatchArithmeticCurrent => "arithmetic_current",
|
|
195
|
+
Self::TypeMismatchArithmeticSharedField => "arithmetic_shared_field",
|
|
196
|
+
Self::UnknownArgumentUnknownArgs => "unknown_args",
|
|
197
|
+
Self::AbsentArgumentAbsentArgs => "absent_args",
|
|
198
|
+
Self::InvariantViolationClosedSetMember => "closed_set_member",
|
|
199
|
+
Self::InvariantViolationValueObjectInvariant => "value_object_invariant",
|
|
200
|
+
Self::InvariantViolationAdmitsDeclaredSet => "admits_declared_set",
|
|
201
|
+
Self::InvariantViolationUndeclaredSet => "undeclared_set",
|
|
202
|
+
Self::InvariantViolationGroupByCollision => "group_by_collision",
|
|
203
|
+
Self::UnauthorizedTenantRequired => "tenant_required",
|
|
204
|
+
Self::UnauthorizedRoleMismatch => "role_mismatch",
|
|
205
|
+
Self::UnauthorizedCrossTenantReference => "cross_tenant_reference",
|
|
206
|
+
Self::AttributeAbsentAbsentRead => "absent_read",
|
|
207
|
+
Self::ProjectionAbsentAbsentRead => "absent_read",
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
/// The row's declared `template`.
|
|
212
|
-
pub fn template(&self) -> &'static str {
|
|
212
|
+
pub const fn template(&self) -> &'static str {
|
|
213
213
|
match self {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
214
|
+
Self::NotFoundCreatingNoIdentity => "{command} creates a {aggregate} — pass {identity}:",
|
|
215
|
+
Self::AlreadyExistsCreatingDuplicate => "{command} creates a {aggregate} that already exists — {identity} {offered}",
|
|
216
|
+
Self::AlreadyExistsEntityDuplicate => "a {entity} already exists on {aggregate} — {identity} {offered}",
|
|
217
|
+
Self::NotFoundActingNoIdentity => "{command} acts on an existing {aggregate} — pass {identity}:",
|
|
218
|
+
Self::NotFoundRecordMissing => "no {aggregate} with {identity} {offered}",
|
|
219
|
+
Self::NotFoundEntityParentNoIdentity => "{command} acts on a {aggregate}'s {entity} — pass {identity}:",
|
|
220
|
+
Self::UnknownVerbEntityUnknown => "{aggregate} has no entity {entity}",
|
|
221
|
+
Self::NotFoundEntityElementNoIdentity => "{command} acts on one {entity} — pass {identity}:",
|
|
222
|
+
Self::NotFoundEntityElementMissing => "no {entity} with {identity} {wants} on {aggregate} {parent_id}",
|
|
223
|
+
Self::NotFoundReferenceTargetMissing => "no {target} with {heads} {key}",
|
|
224
|
+
Self::NotFoundReadModelReferenceMissing => "no {aggregate} with reference {offered}",
|
|
225
|
+
Self::TypeMismatchReadModelObjectReference => "{query} refused — a reference is an id, and {field} arrived as an object",
|
|
226
|
+
Self::UnknownVerbNoQuery => "{aggregate} has no query {query}",
|
|
227
|
+
Self::UnknownVerbEntityQueryMissing => "{entity} has no query {query}",
|
|
228
|
+
Self::UnknownVerbEntityHoldsNoList => "{aggregate} holds no list of {entity}",
|
|
229
|
+
Self::UnknownVerbEntityNoCommand => "{entity} has no command {command}",
|
|
230
|
+
Self::UnknownVerbAggregateNoCommand => "{aggregate} has no command {command}",
|
|
231
|
+
Self::UnknownVerbPortNoOperation => "{port} has no operation {operation}",
|
|
232
|
+
Self::UnknownVerbNoDomain => "no domain {domain} loaded (verb {verb})",
|
|
233
|
+
Self::UnknownVerbNoReadModel => "{domain} has no read model {query}",
|
|
234
|
+
Self::UnknownVerbNotFullyQualified => "{verb} is not a fully-qualified verb (Domain::Aggregate.Command)",
|
|
235
|
+
Self::UnknownVerbNoAggregate => "{domain} has no aggregate {aggregate}",
|
|
236
|
+
Self::LifecycleRefusedTransitionBlocked => "{command} refused — {field} is {current}, and {command} moves it only from {allowed}",
|
|
237
|
+
Self::TypeMismatchValueObjectShape => "{name} is a {type} — pass its fields as an object, not {offered}",
|
|
238
|
+
Self::TypeMismatchReferenceWrongShape => "{command} refused — a reference is an id, and {attribute} arrived as {offered}{known_by}",
|
|
239
|
+
Self::TypeMismatchMultiFieldScalar => "{type} has multiple fields and cannot stand in for a scalar",
|
|
240
|
+
Self::TypeMismatchCompositeIdentity => "{type} is a composite identity — an identity must have exactly one field",
|
|
241
|
+
Self::TypeMismatchNumericField => "{type}.{field} expects {expected}, got {offered}",
|
|
242
|
+
Self::TypeMismatchNonFiniteField => "{type}.{field} must be a finite number, got {offered}",
|
|
243
|
+
Self::TypeMismatchIntegerRange => "{type}.{field} must fit in a 64-bit integer, got {offered}",
|
|
244
|
+
Self::TypeMismatchPatternMismatch => "{type}.{field} must match {pattern}, got {offered}",
|
|
245
|
+
Self::TypeMismatchArithmeticAmount => "{op} of {target} needs an Integer, got {offered}",
|
|
246
|
+
Self::TypeMismatchArithmeticCurrent => "{op} of {target} needs an Integer {target}, got {offered}",
|
|
247
|
+
Self::TypeMismatchArithmeticSharedField => "{op} of {target} needs a value object with one shared Integer field",
|
|
248
|
+
Self::UnknownArgumentUnknownArgs => "{command} does not declare {unknown} — it takes {declared}",
|
|
249
|
+
Self::AbsentArgumentAbsentArgs => "{command} was not given {absent} — it takes {declared}",
|
|
250
|
+
Self::InvariantViolationClosedSetMember => "{type} admits {admitted} — got {offered}",
|
|
251
|
+
Self::InvariantViolationValueObjectInvariant => "{name} invariant violated — {description} (given {offered})",
|
|
252
|
+
Self::InvariantViolationAdmitsDeclaredSet => "{name} admits {admits} — {admitted} — got {offered}",
|
|
253
|
+
Self::InvariantViolationUndeclaredSet => "{name} admits {admits}, which this chapter does not declare — a closed set is named Aggregate::SetName, and it must be one the bluebook actually holds",
|
|
254
|
+
Self::InvariantViolationGroupByCollision => "{read_model} groups by {fields}, but rows {ids} share {key} — a group_by leaf holds one row; add a field that tells them apart",
|
|
255
|
+
Self::UnauthorizedTenantRequired => "{query} declares authorize with tenant: {field} — pass {field}: to name which {field} this ask is scoped to",
|
|
256
|
+
Self::UnauthorizedRoleMismatch => "{command} refused — role: {role}, and the caller stated {caller_role}",
|
|
257
|
+
Self::UnauthorizedCrossTenantReference => "{aggregate} {field} is {tenant}, but {attribute} names a {target} whose own {target_field} is {other} — a cross-tenant reference",
|
|
258
|
+
Self::AttributeAbsentAbsentRead => "{aggregate} {field} is absent on this record — declared, not optional, and added since it was written. Backfill it in a translation (backfill :{field}, default: ...), or declare it optional: true",
|
|
259
|
+
Self::ProjectionAbsentAbsentRead => "{aggregate} {field} is not yet projected on this record — declared via projects :{field}, but no rebuild sweep has populated it. Run the sweep, or read {reference}.{remote_field} directly if this rule cannot wait",
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
|
|
263
263
|
/// The row whose `site` is `name`, if any.
|
|
264
|
-
pub fn from_name(name: &str) -> Option<
|
|
265
|
-
|
|
264
|
+
pub fn from_name(name: &str) -> Option<Self> {
|
|
265
|
+
Self::ALL.iter().copied().find(|row| row.site() == name)
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
/// `RefusalWording.substitute`: replace every `{key}` marker, in the
|
|
269
269
|
/// order given. A template is read, never evaluated. Private: call
|
|
270
270
|
/// sites go through a site's typed `<Variant>Args::render_args`,
|
|
271
271
|
/// which formats and supplies every declared argument.
|
|
272
|
-
fn render(
|
|
272
|
+
fn render(self, values: &[(&str, &str)]) -> String {
|
|
273
273
|
let mut text = self.template().to_string();
|
|
274
274
|
for (key, value) in values {
|
|
275
275
|
text = text.replace(&format!("{{{key}}}"), value);
|
|
@@ -296,7 +296,13 @@ fn list(items: &[&str], sorted: bool, inspect: bool, separator: &str, when_empty
|
|
|
296
296
|
if items.is_empty() {
|
|
297
297
|
return when_empty.to_string();
|
|
298
298
|
}
|
|
299
|
-
let write = |item: &&str|
|
|
299
|
+
let write = |item: &&str| {
|
|
300
|
+
if inspect {
|
|
301
|
+
quoted(item)
|
|
302
|
+
} else {
|
|
303
|
+
item.to_string()
|
|
304
|
+
}
|
|
305
|
+
};
|
|
300
306
|
items.iter().map(write).collect::<Vec<_>>().join(separator)
|
|
301
307
|
}
|
|
302
308
|
|
|
@@ -547,10 +553,8 @@ pub struct NotFoundReadModelReferenceMissingArgs<'a> {
|
|
|
547
553
|
impl NotFoundReadModelReferenceMissingArgs<'_> {
|
|
548
554
|
/// The site's wording, every argument formatted by its declared row.
|
|
549
555
|
pub fn render_args(&self) -> String {
|
|
550
|
-
RefusalSite::NotFoundReadModelReferenceMissing
|
|
551
|
-
("aggregate", self.aggregate),
|
|
552
|
-
("offered", self.offered),
|
|
553
|
-
])
|
|
556
|
+
RefusalSite::NotFoundReadModelReferenceMissing
|
|
557
|
+
.render(&[("aggregate", self.aggregate), ("offered", self.offered)])
|
|
554
558
|
}
|
|
555
559
|
}
|
|
556
560
|
|
|
@@ -566,10 +570,8 @@ pub struct TypeMismatchReadModelObjectReferenceArgs<'a> {
|
|
|
566
570
|
impl TypeMismatchReadModelObjectReferenceArgs<'_> {
|
|
567
571
|
/// The site's wording, every argument formatted by its declared row.
|
|
568
572
|
pub fn render_args(&self) -> String {
|
|
569
|
-
RefusalSite::TypeMismatchReadModelObjectReference
|
|
570
|
-
("query", self.query),
|
|
571
|
-
("field", self.field),
|
|
572
|
-
])
|
|
573
|
+
RefusalSite::TypeMismatchReadModelObjectReference
|
|
574
|
+
.render(&[("query", self.query), ("field", self.field)])
|
|
573
575
|
}
|
|
574
576
|
}
|
|
575
577
|
|
|
@@ -606,10 +608,8 @@ impl UnknownVerbEntityQueryMissingArgs<'_> {
|
|
|
606
608
|
/// The site's wording, every argument formatted by its declared row.
|
|
607
609
|
pub fn render_args(&self) -> String {
|
|
608
610
|
let query_text = quoted(self.query);
|
|
609
|
-
RefusalSite::UnknownVerbEntityQueryMissing
|
|
610
|
-
("entity", self.entity),
|
|
611
|
-
("query", query_text.as_str()),
|
|
612
|
-
])
|
|
611
|
+
RefusalSite::UnknownVerbEntityQueryMissing
|
|
612
|
+
.render(&[("entity", self.entity), ("query", query_text.as_str())])
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
|
|
@@ -625,10 +625,8 @@ pub struct UnknownVerbEntityHoldsNoListArgs<'a> {
|
|
|
625
625
|
impl UnknownVerbEntityHoldsNoListArgs<'_> {
|
|
626
626
|
/// The site's wording, every argument formatted by its declared row.
|
|
627
627
|
pub fn render_args(&self) -> String {
|
|
628
|
-
RefusalSite::UnknownVerbEntityHoldsNoList
|
|
629
|
-
("aggregate", self.aggregate),
|
|
630
|
-
("entity", self.entity),
|
|
631
|
-
])
|
|
628
|
+
RefusalSite::UnknownVerbEntityHoldsNoList
|
|
629
|
+
.render(&[("aggregate", self.aggregate), ("entity", self.entity)])
|
|
632
630
|
}
|
|
633
631
|
}
|
|
634
632
|
|
|
@@ -645,10 +643,8 @@ impl UnknownVerbEntityNoCommandArgs<'_> {
|
|
|
645
643
|
/// The site's wording, every argument formatted by its declared row.
|
|
646
644
|
pub fn render_args(&self) -> String {
|
|
647
645
|
let command_text = quoted(self.command);
|
|
648
|
-
RefusalSite::UnknownVerbEntityNoCommand
|
|
649
|
-
("entity", self.entity),
|
|
650
|
-
("command", command_text.as_str()),
|
|
651
|
-
])
|
|
646
|
+
RefusalSite::UnknownVerbEntityNoCommand
|
|
647
|
+
.render(&[("entity", self.entity), ("command", command_text.as_str())])
|
|
652
648
|
}
|
|
653
649
|
}
|
|
654
650
|
|
|
@@ -685,10 +681,8 @@ impl UnknownVerbPortNoOperationArgs<'_> {
|
|
|
685
681
|
/// The site's wording, every argument formatted by its declared row.
|
|
686
682
|
pub fn render_args(&self) -> String {
|
|
687
683
|
let operation_text = quoted(self.operation);
|
|
688
|
-
RefusalSite::UnknownVerbPortNoOperation
|
|
689
|
-
("port", self.port),
|
|
690
|
-
("operation", operation_text.as_str()),
|
|
691
|
-
])
|
|
684
|
+
RefusalSite::UnknownVerbPortNoOperation
|
|
685
|
+
.render(&[("port", self.port), ("operation", operation_text.as_str())])
|
|
692
686
|
}
|
|
693
687
|
}
|
|
694
688
|
|
|
@@ -705,10 +699,8 @@ impl UnknownVerbNoDomainArgs<'_> {
|
|
|
705
699
|
/// The site's wording, every argument formatted by its declared row.
|
|
706
700
|
pub fn render_args(&self) -> String {
|
|
707
701
|
let domain_text = quoted(self.domain);
|
|
708
|
-
RefusalSite::UnknownVerbNoDomain
|
|
709
|
-
("domain", domain_text.as_str()),
|
|
710
|
-
("verb", self.verb),
|
|
711
|
-
])
|
|
702
|
+
RefusalSite::UnknownVerbNoDomain
|
|
703
|
+
.render(&[("domain", domain_text.as_str()), ("verb", self.verb)])
|
|
712
704
|
}
|
|
713
705
|
}
|
|
714
706
|
|
|
@@ -725,10 +717,8 @@ impl UnknownVerbNoReadModelArgs<'_> {
|
|
|
725
717
|
/// The site's wording, every argument formatted by its declared row.
|
|
726
718
|
pub fn render_args(&self) -> String {
|
|
727
719
|
let query_text = quoted(self.query);
|
|
728
|
-
RefusalSite::UnknownVerbNoReadModel
|
|
729
|
-
("domain", self.domain),
|
|
730
|
-
("query", query_text.as_str()),
|
|
731
|
-
])
|
|
720
|
+
RefusalSite::UnknownVerbNoReadModel
|
|
721
|
+
.render(&[("domain", self.domain), ("query", query_text.as_str())])
|
|
732
722
|
}
|
|
733
723
|
}
|
|
734
724
|
|
|
@@ -743,9 +733,7 @@ impl UnknownVerbNotFullyQualifiedArgs<'_> {
|
|
|
743
733
|
/// The site's wording, every argument formatted by its declared row.
|
|
744
734
|
pub fn render_args(&self) -> String {
|
|
745
735
|
let verb_text = quoted(self.verb);
|
|
746
|
-
RefusalSite::UnknownVerbNotFullyQualified.render(&[
|
|
747
|
-
("verb", verb_text.as_str()),
|
|
748
|
-
])
|
|
736
|
+
RefusalSite::UnknownVerbNotFullyQualified.render(&[("verb", verb_text.as_str())])
|
|
749
737
|
}
|
|
750
738
|
}
|
|
751
739
|
|
|
@@ -852,9 +840,7 @@ pub struct TypeMismatchMultiFieldScalarArgs<'a> {
|
|
|
852
840
|
impl TypeMismatchMultiFieldScalarArgs<'_> {
|
|
853
841
|
/// The site's wording, every argument formatted by its declared row.
|
|
854
842
|
pub fn render_args(&self) -> String {
|
|
855
|
-
RefusalSite::TypeMismatchMultiFieldScalar.render(&[
|
|
856
|
-
("type", self.r#type),
|
|
857
|
-
])
|
|
843
|
+
RefusalSite::TypeMismatchMultiFieldScalar.render(&[("type", self.r#type)])
|
|
858
844
|
}
|
|
859
845
|
}
|
|
860
846
|
|
|
@@ -868,9 +854,7 @@ pub struct TypeMismatchCompositeIdentityArgs<'a> {
|
|
|
868
854
|
impl TypeMismatchCompositeIdentityArgs<'_> {
|
|
869
855
|
/// The site's wording, every argument formatted by its declared row.
|
|
870
856
|
pub fn render_args(&self) -> String {
|
|
871
|
-
RefusalSite::TypeMismatchCompositeIdentity.render(&[
|
|
872
|
-
("type", self.r#type),
|
|
873
|
-
])
|
|
857
|
+
RefusalSite::TypeMismatchCompositeIdentity.render(&[("type", self.r#type)])
|
|
874
858
|
}
|
|
875
859
|
}
|
|
876
860
|
|
|
@@ -1024,10 +1008,8 @@ pub struct TypeMismatchArithmeticSharedFieldArgs<'a> {
|
|
|
1024
1008
|
impl TypeMismatchArithmeticSharedFieldArgs<'_> {
|
|
1025
1009
|
/// The site's wording, every argument formatted by its declared row.
|
|
1026
1010
|
pub fn render_args(&self) -> String {
|
|
1027
|
-
RefusalSite::TypeMismatchArithmeticSharedField
|
|
1028
|
-
("op", self.op),
|
|
1029
|
-
("target", self.target),
|
|
1030
|
-
])
|
|
1011
|
+
RefusalSite::TypeMismatchArithmeticSharedField
|
|
1012
|
+
.render(&[("op", self.op), ("target", self.target)])
|
|
1031
1013
|
}
|
|
1032
1014
|
}
|
|
1033
1015
|
|
|
@@ -1162,10 +1144,8 @@ pub struct InvariantViolationUndeclaredSetArgs<'a> {
|
|
|
1162
1144
|
impl InvariantViolationUndeclaredSetArgs<'_> {
|
|
1163
1145
|
/// The site's wording, every argument formatted by its declared row.
|
|
1164
1146
|
pub fn render_args(&self) -> String {
|
|
1165
|
-
RefusalSite::InvariantViolationUndeclaredSet
|
|
1166
|
-
("name", self.name),
|
|
1167
|
-
("admits", self.admits),
|
|
1168
|
-
])
|
|
1147
|
+
RefusalSite::InvariantViolationUndeclaredSet
|
|
1148
|
+
.render(&[("name", self.name), ("admits", self.admits)])
|
|
1169
1149
|
}
|
|
1170
1150
|
}
|
|
1171
1151
|
|
|
@@ -1208,10 +1188,8 @@ pub struct UnauthorizedTenantRequiredArgs<'a> {
|
|
|
1208
1188
|
impl UnauthorizedTenantRequiredArgs<'_> {
|
|
1209
1189
|
/// The site's wording, every argument formatted by its declared row.
|
|
1210
1190
|
pub fn render_args(&self) -> String {
|
|
1211
|
-
RefusalSite::UnauthorizedTenantRequired
|
|
1212
|
-
("query", self.query),
|
|
1213
|
-
("field", self.field),
|
|
1214
|
-
])
|
|
1191
|
+
RefusalSite::UnauthorizedTenantRequired
|
|
1192
|
+
.render(&[("query", self.query), ("field", self.field)])
|
|
1215
1193
|
}
|
|
1216
1194
|
}
|
|
1217
1195
|
|
|
@@ -1283,10 +1261,8 @@ pub struct AttributeAbsentAbsentReadArgs<'a> {
|
|
|
1283
1261
|
impl AttributeAbsentAbsentReadArgs<'_> {
|
|
1284
1262
|
/// The site's wording, every argument formatted by its declared row.
|
|
1285
1263
|
pub fn render_args(&self) -> String {
|
|
1286
|
-
RefusalSite::AttributeAbsentAbsentRead
|
|
1287
|
-
("aggregate", self.aggregate),
|
|
1288
|
-
("field", self.field),
|
|
1289
|
-
])
|
|
1264
|
+
RefusalSite::AttributeAbsentAbsentRead
|
|
1265
|
+
.render(&[("aggregate", self.aggregate), ("field", self.field)])
|
|
1290
1266
|
}
|
|
1291
1267
|
}
|
|
1292
1268
|
|
|
@@ -1336,8 +1312,12 @@ mod tests {
|
|
|
1336
1312
|
(_, None) => {}
|
|
1337
1313
|
}
|
|
1338
1314
|
}
|
|
1339
|
-
let dummies: Vec<(String, String)> =
|
|
1340
|
-
|
|
1315
|
+
let dummies: Vec<(String, String)> =
|
|
1316
|
+
keys.iter().map(|k| (k.clone(), format!("<{k}>"))).collect();
|
|
1317
|
+
let pairs: Vec<(&str, &str)> = dummies
|
|
1318
|
+
.iter()
|
|
1319
|
+
.map(|(k, v)| (k.as_str(), v.as_str()))
|
|
1320
|
+
.collect();
|
|
1341
1321
|
let rendered = site.render(&pairs);
|
|
1342
1322
|
assert!(
|
|
1343
1323
|
!rendered.contains('{') && !rendered.contains('}'),
|
|
@@ -1349,7 +1329,12 @@ mod tests {
|
|
|
1349
1329
|
#[test]
|
|
1350
1330
|
fn render_args_matches_ruby_render_site() {
|
|
1351
1331
|
assert_eq!(
|
|
1352
|
-
NotFoundCreatingNoIdentityArgs {
|
|
1332
|
+
NotFoundCreatingNoIdentityArgs {
|
|
1333
|
+
command: "command \"x\"",
|
|
1334
|
+
aggregate: "aggregate \"x\"",
|
|
1335
|
+
identity: "identity \"x\""
|
|
1336
|
+
}
|
|
1337
|
+
.render_args(),
|
|
1353
1338
|
"command \"x\" creates a aggregate \"x\" — pass identity \"x\":"
|
|
1354
1339
|
);
|
|
1355
1340
|
assert_eq!(
|
|
@@ -1357,83 +1342,178 @@ mod tests {
|
|
|
1357
1342
|
"command \"x\" creates a aggregate \"x\" that already exists — identity \"x\" offered \"x\""
|
|
1358
1343
|
);
|
|
1359
1344
|
assert_eq!(
|
|
1360
|
-
AlreadyExistsEntityDuplicateArgs {
|
|
1345
|
+
AlreadyExistsEntityDuplicateArgs {
|
|
1346
|
+
entity: "entity \"x\"",
|
|
1347
|
+
aggregate: "aggregate \"x\"",
|
|
1348
|
+
identity: "identity \"x\"",
|
|
1349
|
+
offered: &[]
|
|
1350
|
+
}
|
|
1351
|
+
.render_args(),
|
|
1361
1352
|
"a entity \"x\" already exists on aggregate \"x\" — identity \"x\" "
|
|
1362
1353
|
);
|
|
1363
1354
|
assert_eq!(
|
|
1364
|
-
AlreadyExistsEntityDuplicateArgs {
|
|
1355
|
+
AlreadyExistsEntityDuplicateArgs {
|
|
1356
|
+
entity: "entity \"x\"",
|
|
1357
|
+
aggregate: "aggregate \"x\"",
|
|
1358
|
+
identity: "identity \"x\"",
|
|
1359
|
+
offered: &["only \"one\""]
|
|
1360
|
+
}
|
|
1361
|
+
.render_args(),
|
|
1365
1362
|
"a entity \"x\" already exists on aggregate \"x\" — identity \"x\" only \"one\""
|
|
1366
1363
|
);
|
|
1367
1364
|
assert_eq!(
|
|
1368
|
-
AlreadyExistsEntityDuplicateArgs {
|
|
1365
|
+
AlreadyExistsEntityDuplicateArgs {
|
|
1366
|
+
entity: "entity \"x\"",
|
|
1367
|
+
aggregate: "aggregate \"x\"",
|
|
1368
|
+
identity: "identity \"x\"",
|
|
1369
|
+
offered: &["zeta", "alpha", "mid"]
|
|
1370
|
+
}
|
|
1371
|
+
.render_args(),
|
|
1369
1372
|
"a entity \"x\" already exists on aggregate \"x\" — identity \"x\" zeta, alpha, mid"
|
|
1370
1373
|
);
|
|
1371
1374
|
assert_eq!(
|
|
1372
|
-
NotFoundActingNoIdentityArgs {
|
|
1375
|
+
NotFoundActingNoIdentityArgs {
|
|
1376
|
+
command: "command \"x\"",
|
|
1377
|
+
aggregate: "aggregate \"x\"",
|
|
1378
|
+
identity: "identity \"x\""
|
|
1379
|
+
}
|
|
1380
|
+
.render_args(),
|
|
1373
1381
|
"command \"x\" acts on an existing aggregate \"x\" — pass identity \"x\":"
|
|
1374
1382
|
);
|
|
1375
1383
|
assert_eq!(
|
|
1376
|
-
NotFoundRecordMissingArgs {
|
|
1384
|
+
NotFoundRecordMissingArgs {
|
|
1385
|
+
aggregate: "aggregate \"x\"",
|
|
1386
|
+
identity: "identity \"x\"",
|
|
1387
|
+
offered: "offered \"x\""
|
|
1388
|
+
}
|
|
1389
|
+
.render_args(),
|
|
1377
1390
|
"no aggregate \"x\" with identity \"x\" offered \"x\""
|
|
1378
1391
|
);
|
|
1379
1392
|
assert_eq!(
|
|
1380
|
-
NotFoundEntityParentNoIdentityArgs {
|
|
1393
|
+
NotFoundEntityParentNoIdentityArgs {
|
|
1394
|
+
command: "command \"x\"",
|
|
1395
|
+
aggregate: "aggregate \"x\"",
|
|
1396
|
+
entity: "entity \"x\"",
|
|
1397
|
+
identity: "identity \"x\""
|
|
1398
|
+
}
|
|
1399
|
+
.render_args(),
|
|
1381
1400
|
"command \"x\" acts on a aggregate \"x\"'s entity \"x\" — pass identity \"x\":"
|
|
1382
1401
|
);
|
|
1383
1402
|
assert_eq!(
|
|
1384
|
-
UnknownVerbEntityUnknownArgs {
|
|
1403
|
+
UnknownVerbEntityUnknownArgs {
|
|
1404
|
+
aggregate: "aggregate \"x\"",
|
|
1405
|
+
entity: "entity \"x\""
|
|
1406
|
+
}
|
|
1407
|
+
.render_args(),
|
|
1385
1408
|
"aggregate \"x\" has no entity \"entity \\\"x\\\"\""
|
|
1386
1409
|
);
|
|
1387
1410
|
assert_eq!(
|
|
1388
|
-
NotFoundEntityElementNoIdentityArgs {
|
|
1411
|
+
NotFoundEntityElementNoIdentityArgs {
|
|
1412
|
+
command: "command \"x\"",
|
|
1413
|
+
entity: "entity \"x\"",
|
|
1414
|
+
identity: "identity \"x\""
|
|
1415
|
+
}
|
|
1416
|
+
.render_args(),
|
|
1389
1417
|
"command \"x\" acts on one entity \"x\" — pass identity \"x\":"
|
|
1390
1418
|
);
|
|
1391
1419
|
assert_eq!(
|
|
1392
|
-
NotFoundEntityElementMissingArgs {
|
|
1420
|
+
NotFoundEntityElementMissingArgs {
|
|
1421
|
+
entity: "entity \"x\"",
|
|
1422
|
+
identity: "identity \"x\"",
|
|
1423
|
+
wants: "wants \"x\"",
|
|
1424
|
+
aggregate: "aggregate \"x\"",
|
|
1425
|
+
parent_id: "parent_id \"x\""
|
|
1426
|
+
}
|
|
1427
|
+
.render_args(),
|
|
1393
1428
|
"no entity \"x\" with identity \"x\" wants \"x\" on aggregate \"x\" parent_id \"x\""
|
|
1394
1429
|
);
|
|
1395
1430
|
assert_eq!(
|
|
1396
|
-
NotFoundReferenceTargetMissingArgs {
|
|
1431
|
+
NotFoundReferenceTargetMissingArgs {
|
|
1432
|
+
target: "target \"x\"",
|
|
1433
|
+
heads: "heads \"x\"",
|
|
1434
|
+
key: "key \"x\""
|
|
1435
|
+
}
|
|
1436
|
+
.render_args(),
|
|
1397
1437
|
"no target \"x\" with heads \"x\" \"key \\\"x\\\"\""
|
|
1398
1438
|
);
|
|
1399
1439
|
assert_eq!(
|
|
1400
|
-
NotFoundReadModelReferenceMissingArgs {
|
|
1440
|
+
NotFoundReadModelReferenceMissingArgs {
|
|
1441
|
+
aggregate: "aggregate \"x\"",
|
|
1442
|
+
offered: "offered \"x\""
|
|
1443
|
+
}
|
|
1444
|
+
.render_args(),
|
|
1401
1445
|
"no aggregate \"x\" with reference offered \"x\""
|
|
1402
1446
|
);
|
|
1403
1447
|
assert_eq!(
|
|
1404
|
-
TypeMismatchReadModelObjectReferenceArgs {
|
|
1448
|
+
TypeMismatchReadModelObjectReferenceArgs {
|
|
1449
|
+
query: "query \"x\"",
|
|
1450
|
+
field: "field \"x\""
|
|
1451
|
+
}
|
|
1452
|
+
.render_args(),
|
|
1405
1453
|
"query \"x\" refused — a reference is an id, and field \"x\" arrived as an object"
|
|
1406
1454
|
);
|
|
1407
1455
|
assert_eq!(
|
|
1408
|
-
UnknownVerbNoQueryArgs {
|
|
1456
|
+
UnknownVerbNoQueryArgs {
|
|
1457
|
+
aggregate: "aggregate \"x\"",
|
|
1458
|
+
query: "query \"x\""
|
|
1459
|
+
}
|
|
1460
|
+
.render_args(),
|
|
1409
1461
|
"aggregate \"x\" has no query \"query \\\"x\\\"\""
|
|
1410
1462
|
);
|
|
1411
1463
|
assert_eq!(
|
|
1412
|
-
UnknownVerbEntityQueryMissingArgs {
|
|
1464
|
+
UnknownVerbEntityQueryMissingArgs {
|
|
1465
|
+
entity: "entity \"x\"",
|
|
1466
|
+
query: "query \"x\""
|
|
1467
|
+
}
|
|
1468
|
+
.render_args(),
|
|
1413
1469
|
"entity \"x\" has no query \"query \\\"x\\\"\""
|
|
1414
1470
|
);
|
|
1415
1471
|
assert_eq!(
|
|
1416
|
-
UnknownVerbEntityHoldsNoListArgs {
|
|
1472
|
+
UnknownVerbEntityHoldsNoListArgs {
|
|
1473
|
+
aggregate: "aggregate \"x\"",
|
|
1474
|
+
entity: "entity \"x\""
|
|
1475
|
+
}
|
|
1476
|
+
.render_args(),
|
|
1417
1477
|
"aggregate \"x\" holds no list of entity \"x\""
|
|
1418
1478
|
);
|
|
1419
1479
|
assert_eq!(
|
|
1420
|
-
UnknownVerbEntityNoCommandArgs {
|
|
1480
|
+
UnknownVerbEntityNoCommandArgs {
|
|
1481
|
+
entity: "entity \"x\"",
|
|
1482
|
+
command: "command \"x\""
|
|
1483
|
+
}
|
|
1484
|
+
.render_args(),
|
|
1421
1485
|
"entity \"x\" has no command \"command \\\"x\\\"\""
|
|
1422
1486
|
);
|
|
1423
1487
|
assert_eq!(
|
|
1424
|
-
UnknownVerbAggregateNoCommandArgs {
|
|
1488
|
+
UnknownVerbAggregateNoCommandArgs {
|
|
1489
|
+
aggregate: "aggregate \"x\"",
|
|
1490
|
+
command: "command \"x\""
|
|
1491
|
+
}
|
|
1492
|
+
.render_args(),
|
|
1425
1493
|
"aggregate \"x\" has no command \"command \\\"x\\\"\""
|
|
1426
1494
|
);
|
|
1427
1495
|
assert_eq!(
|
|
1428
|
-
UnknownVerbPortNoOperationArgs {
|
|
1496
|
+
UnknownVerbPortNoOperationArgs {
|
|
1497
|
+
port: "port \"x\"",
|
|
1498
|
+
operation: "operation \"x\""
|
|
1499
|
+
}
|
|
1500
|
+
.render_args(),
|
|
1429
1501
|
"port \"x\" has no operation \"operation \\\"x\\\"\""
|
|
1430
1502
|
);
|
|
1431
1503
|
assert_eq!(
|
|
1432
|
-
UnknownVerbNoDomainArgs {
|
|
1504
|
+
UnknownVerbNoDomainArgs {
|
|
1505
|
+
domain: "domain \"x\"",
|
|
1506
|
+
verb: "verb \"x\""
|
|
1507
|
+
}
|
|
1508
|
+
.render_args(),
|
|
1433
1509
|
"no domain \"domain \\\"x\\\"\" loaded (verb verb \"x\")"
|
|
1434
1510
|
);
|
|
1435
1511
|
assert_eq!(
|
|
1436
|
-
UnknownVerbNoReadModelArgs {
|
|
1512
|
+
UnknownVerbNoReadModelArgs {
|
|
1513
|
+
domain: "domain \"x\"",
|
|
1514
|
+
query: "query \"x\""
|
|
1515
|
+
}
|
|
1516
|
+
.render_args(),
|
|
1437
1517
|
"domain \"x\" has no read model \"query \\\"x\\\"\""
|
|
1438
1518
|
);
|
|
1439
1519
|
assert_eq!(
|
|
@@ -1441,7 +1521,11 @@ mod tests {
|
|
|
1441
1521
|
"\"verb \\\"x\\\"\" is not a fully-qualified verb (Domain::Aggregate.Command)"
|
|
1442
1522
|
);
|
|
1443
1523
|
assert_eq!(
|
|
1444
|
-
UnknownVerbNoAggregateArgs {
|
|
1524
|
+
UnknownVerbNoAggregateArgs {
|
|
1525
|
+
domain: "domain \"x\"",
|
|
1526
|
+
aggregate: "aggregate \"x\""
|
|
1527
|
+
}
|
|
1528
|
+
.render_args(),
|
|
1445
1529
|
"domain \"x\" has no aggregate \"aggregate \\\"x\\\"\""
|
|
1446
1530
|
);
|
|
1447
1531
|
assert_eq!(
|
|
@@ -1457,7 +1541,12 @@ mod tests {
|
|
|
1457
1541
|
"command \"x\" refused — field \"x\" is current \"x\", and command \"x\" moves it only from \"zeta\" or \"alpha\" or \"mid\""
|
|
1458
1542
|
);
|
|
1459
1543
|
assert_eq!(
|
|
1460
|
-
TypeMismatchValueObjectShapeArgs {
|
|
1544
|
+
TypeMismatchValueObjectShapeArgs {
|
|
1545
|
+
name: "name \"x\"",
|
|
1546
|
+
r#type: "type \"x\"",
|
|
1547
|
+
offered: "offered \"x\""
|
|
1548
|
+
}
|
|
1549
|
+
.render_args(),
|
|
1461
1550
|
"name \"x\" is a type \"x\" — pass its fields as an object, not offered \"x\""
|
|
1462
1551
|
);
|
|
1463
1552
|
assert_eq!(
|
|
@@ -1465,91 +1554,201 @@ mod tests {
|
|
|
1465
1554
|
"command \"x\" refused — a reference is an id, and attribute \"x\" arrived as offered \"x\"known_by \"x\""
|
|
1466
1555
|
);
|
|
1467
1556
|
assert_eq!(
|
|
1468
|
-
TypeMismatchMultiFieldScalarArgs {
|
|
1557
|
+
TypeMismatchMultiFieldScalarArgs {
|
|
1558
|
+
r#type: "type \"x\""
|
|
1559
|
+
}
|
|
1560
|
+
.render_args(),
|
|
1469
1561
|
"type \"x\" has multiple fields and cannot stand in for a scalar"
|
|
1470
1562
|
);
|
|
1471
1563
|
assert_eq!(
|
|
1472
|
-
TypeMismatchCompositeIdentityArgs {
|
|
1564
|
+
TypeMismatchCompositeIdentityArgs {
|
|
1565
|
+
r#type: "type \"x\""
|
|
1566
|
+
}
|
|
1567
|
+
.render_args(),
|
|
1473
1568
|
"type \"x\" is a composite identity — an identity must have exactly one field"
|
|
1474
1569
|
);
|
|
1475
1570
|
assert_eq!(
|
|
1476
|
-
TypeMismatchNumericFieldArgs {
|
|
1571
|
+
TypeMismatchNumericFieldArgs {
|
|
1572
|
+
r#type: "type \"x\"",
|
|
1573
|
+
field: "field \"x\"",
|
|
1574
|
+
expected: "expected \"x\"",
|
|
1575
|
+
offered: "offered \"x\""
|
|
1576
|
+
}
|
|
1577
|
+
.render_args(),
|
|
1477
1578
|
"type \"x\".field \"x\" expects expected \"x\", got offered \"x\""
|
|
1478
1579
|
);
|
|
1479
1580
|
assert_eq!(
|
|
1480
|
-
TypeMismatchNonFiniteFieldArgs {
|
|
1581
|
+
TypeMismatchNonFiniteFieldArgs {
|
|
1582
|
+
r#type: "type \"x\"",
|
|
1583
|
+
field: "field \"x\"",
|
|
1584
|
+
offered: "offered \"x\""
|
|
1585
|
+
}
|
|
1586
|
+
.render_args(),
|
|
1481
1587
|
"type \"x\".field \"x\" must be a finite number, got offered \"x\""
|
|
1482
1588
|
);
|
|
1483
1589
|
assert_eq!(
|
|
1484
|
-
TypeMismatchIntegerRangeArgs {
|
|
1590
|
+
TypeMismatchIntegerRangeArgs {
|
|
1591
|
+
r#type: "type \"x\"",
|
|
1592
|
+
field: "field \"x\"",
|
|
1593
|
+
offered: "offered \"x\""
|
|
1594
|
+
}
|
|
1595
|
+
.render_args(),
|
|
1485
1596
|
"type \"x\".field \"x\" must fit in a 64-bit integer, got offered \"x\""
|
|
1486
1597
|
);
|
|
1487
1598
|
assert_eq!(
|
|
1488
|
-
TypeMismatchPatternMismatchArgs {
|
|
1599
|
+
TypeMismatchPatternMismatchArgs {
|
|
1600
|
+
r#type: "type \"x\"",
|
|
1601
|
+
field: "field \"x\"",
|
|
1602
|
+
pattern: "pattern \"x\"",
|
|
1603
|
+
offered: "offered \"x\""
|
|
1604
|
+
}
|
|
1605
|
+
.render_args(),
|
|
1489
1606
|
"type \"x\".field \"x\" must match pattern \"x\", got offered \"x\""
|
|
1490
1607
|
);
|
|
1491
1608
|
assert_eq!(
|
|
1492
|
-
TypeMismatchArithmeticAmountArgs {
|
|
1609
|
+
TypeMismatchArithmeticAmountArgs {
|
|
1610
|
+
op: "op \"x\"",
|
|
1611
|
+
target: "target \"x\"",
|
|
1612
|
+
offered: "offered \"x\""
|
|
1613
|
+
}
|
|
1614
|
+
.render_args(),
|
|
1493
1615
|
"op \"x\" of target \"x\" needs an Integer, got offered \"x\""
|
|
1494
1616
|
);
|
|
1495
1617
|
assert_eq!(
|
|
1496
|
-
TypeMismatchArithmeticCurrentArgs {
|
|
1618
|
+
TypeMismatchArithmeticCurrentArgs {
|
|
1619
|
+
op: "op \"x\"",
|
|
1620
|
+
target: "target \"x\"",
|
|
1621
|
+
offered: "offered \"x\""
|
|
1622
|
+
}
|
|
1623
|
+
.render_args(),
|
|
1497
1624
|
"op \"x\" of target \"x\" needs an Integer target \"x\", got offered \"x\""
|
|
1498
1625
|
);
|
|
1499
1626
|
assert_eq!(
|
|
1500
|
-
TypeMismatchArithmeticSharedFieldArgs {
|
|
1627
|
+
TypeMismatchArithmeticSharedFieldArgs {
|
|
1628
|
+
op: "op \"x\"",
|
|
1629
|
+
target: "target \"x\""
|
|
1630
|
+
}
|
|
1631
|
+
.render_args(),
|
|
1501
1632
|
"op \"x\" of target \"x\" needs a value object with one shared Integer field"
|
|
1502
1633
|
);
|
|
1503
1634
|
assert_eq!(
|
|
1504
|
-
UnknownArgumentUnknownArgsArgs {
|
|
1635
|
+
UnknownArgumentUnknownArgsArgs {
|
|
1636
|
+
command: "command \"x\"",
|
|
1637
|
+
unknown: &[],
|
|
1638
|
+
declared: &[]
|
|
1639
|
+
}
|
|
1640
|
+
.render_args(),
|
|
1505
1641
|
"command \"x\" does not declare — it takes none"
|
|
1506
1642
|
);
|
|
1507
1643
|
assert_eq!(
|
|
1508
|
-
UnknownArgumentUnknownArgsArgs {
|
|
1644
|
+
UnknownArgumentUnknownArgsArgs {
|
|
1645
|
+
command: "command \"x\"",
|
|
1646
|
+
unknown: &["only \"one\""],
|
|
1647
|
+
declared: &["only \"one\""]
|
|
1648
|
+
}
|
|
1649
|
+
.render_args(),
|
|
1509
1650
|
"command \"x\" does not declare only \"one\" — it takes only \"one\""
|
|
1510
1651
|
);
|
|
1511
1652
|
assert_eq!(
|
|
1512
|
-
UnknownArgumentUnknownArgsArgs {
|
|
1653
|
+
UnknownArgumentUnknownArgsArgs {
|
|
1654
|
+
command: "command \"x\"",
|
|
1655
|
+
unknown: &["zeta", "alpha", "mid"],
|
|
1656
|
+
declared: &["zeta", "alpha", "mid"]
|
|
1657
|
+
}
|
|
1658
|
+
.render_args(),
|
|
1513
1659
|
"command \"x\" does not declare alpha, mid, zeta — it takes zeta, alpha, mid"
|
|
1514
1660
|
);
|
|
1515
1661
|
assert_eq!(
|
|
1516
|
-
AbsentArgumentAbsentArgsArgs {
|
|
1662
|
+
AbsentArgumentAbsentArgsArgs {
|
|
1663
|
+
command: "command \"x\"",
|
|
1664
|
+
absent: &[],
|
|
1665
|
+
declared: &[]
|
|
1666
|
+
}
|
|
1667
|
+
.render_args(),
|
|
1517
1668
|
"command \"x\" was not given — it takes none"
|
|
1518
1669
|
);
|
|
1519
1670
|
assert_eq!(
|
|
1520
|
-
AbsentArgumentAbsentArgsArgs {
|
|
1671
|
+
AbsentArgumentAbsentArgsArgs {
|
|
1672
|
+
command: "command \"x\"",
|
|
1673
|
+
absent: &["only \"one\""],
|
|
1674
|
+
declared: &["only \"one\""]
|
|
1675
|
+
}
|
|
1676
|
+
.render_args(),
|
|
1521
1677
|
"command \"x\" was not given only \"one\" — it takes only \"one\""
|
|
1522
1678
|
);
|
|
1523
1679
|
assert_eq!(
|
|
1524
|
-
AbsentArgumentAbsentArgsArgs {
|
|
1680
|
+
AbsentArgumentAbsentArgsArgs {
|
|
1681
|
+
command: "command \"x\"",
|
|
1682
|
+
absent: &["zeta", "alpha", "mid"],
|
|
1683
|
+
declared: &["zeta", "alpha", "mid"]
|
|
1684
|
+
}
|
|
1685
|
+
.render_args(),
|
|
1525
1686
|
"command \"x\" was not given alpha, mid, zeta — it takes zeta, alpha, mid"
|
|
1526
1687
|
);
|
|
1527
1688
|
assert_eq!(
|
|
1528
|
-
InvariantViolationClosedSetMemberArgs {
|
|
1689
|
+
InvariantViolationClosedSetMemberArgs {
|
|
1690
|
+
r#type: "type \"x\"",
|
|
1691
|
+
admitted: &[],
|
|
1692
|
+
offered: "offered \"x\""
|
|
1693
|
+
}
|
|
1694
|
+
.render_args(),
|
|
1529
1695
|
"type \"x\" admits — got offered \"x\""
|
|
1530
1696
|
);
|
|
1531
1697
|
assert_eq!(
|
|
1532
|
-
InvariantViolationClosedSetMemberArgs {
|
|
1698
|
+
InvariantViolationClosedSetMemberArgs {
|
|
1699
|
+
r#type: "type \"x\"",
|
|
1700
|
+
admitted: &["only \"one\""],
|
|
1701
|
+
offered: "offered \"x\""
|
|
1702
|
+
}
|
|
1703
|
+
.render_args(),
|
|
1533
1704
|
"type \"x\" admits \"only \\\"one\\\"\" — got offered \"x\""
|
|
1534
1705
|
);
|
|
1535
1706
|
assert_eq!(
|
|
1536
|
-
InvariantViolationClosedSetMemberArgs {
|
|
1707
|
+
InvariantViolationClosedSetMemberArgs {
|
|
1708
|
+
r#type: "type \"x\"",
|
|
1709
|
+
admitted: &["zeta", "alpha", "mid"],
|
|
1710
|
+
offered: "offered \"x\""
|
|
1711
|
+
}
|
|
1712
|
+
.render_args(),
|
|
1537
1713
|
"type \"x\" admits \"zeta\", \"alpha\", \"mid\" — got offered \"x\""
|
|
1538
1714
|
);
|
|
1539
1715
|
assert_eq!(
|
|
1540
|
-
InvariantViolationValueObjectInvariantArgs {
|
|
1716
|
+
InvariantViolationValueObjectInvariantArgs {
|
|
1717
|
+
name: "name \"x\"",
|
|
1718
|
+
description: "description \"x\"",
|
|
1719
|
+
offered: "offered \"x\""
|
|
1720
|
+
}
|
|
1721
|
+
.render_args(),
|
|
1541
1722
|
"name \"x\" invariant violated — description \"x\" (given offered \"x\")"
|
|
1542
1723
|
);
|
|
1543
1724
|
assert_eq!(
|
|
1544
|
-
InvariantViolationAdmitsDeclaredSetArgs {
|
|
1725
|
+
InvariantViolationAdmitsDeclaredSetArgs {
|
|
1726
|
+
name: "name \"x\"",
|
|
1727
|
+
admits: "admits \"x\"",
|
|
1728
|
+
admitted: &[],
|
|
1729
|
+
offered: "offered \"x\""
|
|
1730
|
+
}
|
|
1731
|
+
.render_args(),
|
|
1545
1732
|
"name \"x\" admits admits \"x\" — — got offered \"x\""
|
|
1546
1733
|
);
|
|
1547
1734
|
assert_eq!(
|
|
1548
|
-
InvariantViolationAdmitsDeclaredSetArgs {
|
|
1735
|
+
InvariantViolationAdmitsDeclaredSetArgs {
|
|
1736
|
+
name: "name \"x\"",
|
|
1737
|
+
admits: "admits \"x\"",
|
|
1738
|
+
admitted: &["only \"one\""],
|
|
1739
|
+
offered: "offered \"x\""
|
|
1740
|
+
}
|
|
1741
|
+
.render_args(),
|
|
1549
1742
|
"name \"x\" admits admits \"x\" — \"only \\\"one\\\"\" — got offered \"x\""
|
|
1550
1743
|
);
|
|
1551
1744
|
assert_eq!(
|
|
1552
|
-
InvariantViolationAdmitsDeclaredSetArgs {
|
|
1745
|
+
InvariantViolationAdmitsDeclaredSetArgs {
|
|
1746
|
+
name: "name \"x\"",
|
|
1747
|
+
admits: "admits \"x\"",
|
|
1748
|
+
admitted: &["zeta", "alpha", "mid"],
|
|
1749
|
+
offered: "offered \"x\""
|
|
1750
|
+
}
|
|
1751
|
+
.render_args(),
|
|
1553
1752
|
"name \"x\" admits admits \"x\" — \"zeta\", \"alpha\", \"mid\" — got offered \"x\""
|
|
1554
1753
|
);
|
|
1555
1754
|
assert_eq!(
|
|
@@ -1573,7 +1772,12 @@ mod tests {
|
|
|
1573
1772
|
"query \"x\" declares authorize with tenant: field \"x\" — pass field \"x\": to name which field \"x\" this ask is scoped to"
|
|
1574
1773
|
);
|
|
1575
1774
|
assert_eq!(
|
|
1576
|
-
UnauthorizedRoleMismatchArgs {
|
|
1775
|
+
UnauthorizedRoleMismatchArgs {
|
|
1776
|
+
command: "command \"x\"",
|
|
1777
|
+
role: "role \"x\"",
|
|
1778
|
+
caller_role: "caller_role \"x\""
|
|
1779
|
+
}
|
|
1780
|
+
.render_args(),
|
|
1577
1781
|
"command \"x\" refused — role: role \"x\", and the caller stated caller_role \"x\""
|
|
1578
1782
|
);
|
|
1579
1783
|
assert_eq!(
|