hecks 3.4.2 → 3.6.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/bluebook/hecksagon/mock_stripe_payment_adapter.rb +1 -1
- data/lib/hecks/adapters/driven/claude_code.rb +11 -7
- data/lib/hecks/adapters/driven/d1/connection.rb +90 -0
- data/lib/hecks/adapters/driven/d1.rb +48 -314
- data/lib/hecks/adapters/driven/folder.rb +20 -10
- data/lib/hecks/adapters/driven/google_authentication.rb +18 -4
- data/lib/hecks/adapters/driven/governance_authorization.rb +2 -2
- data/lib/hecks/adapters/driven/heki/journal.rb +11 -10
- data/lib/hecks/adapters/driven/heki/saga_store.rb +4 -6
- data/lib/hecks/adapters/driven/heki/sagas.rb +55 -0
- data/lib/hecks/adapters/driven/heki.rb +21 -66
- data/lib/hecks/adapters/driven/in_memory_ordering.rb +37 -12
- data/lib/hecks/adapters/driven/lambda/client.rb +1 -1
- data/lib/hecks/adapters/driven/lambda.rb +1 -8
- data/lib/hecks/adapters/driven/memory/outbox_rows.rb +76 -0
- data/lib/hecks/adapters/driven/memory/shared_elements/values.rb +117 -0
- data/lib/hecks/adapters/driven/memory/shared_elements.rb +10 -97
- data/lib/hecks/adapters/driven/memory.rb +3 -65
- data/lib/hecks/adapters/driven/postgres/codec.rb +29 -26
- data/lib/hecks/adapters/driven/postgres/ddl.rb +50 -0
- data/lib/hecks/adapters/driven/postgres/dialect.rb +93 -0
- data/lib/hecks/adapters/driven/postgres/events.rb +57 -0
- data/lib/hecks/adapters/driven/postgres/journal.rb +127 -0
- data/lib/hecks/adapters/driven/postgres/outbox.rb +39 -31
- data/lib/hecks/adapters/driven/postgres/repository.rb +190 -0
- data/lib/hecks/adapters/driven/postgres/sagas.rb +72 -0
- data/lib/hecks/adapters/driven/postgres/schema_builder.rb +13 -41
- data/lib/hecks/adapters/driven/postgres.rb +61 -528
- data/lib/hecks/adapters/driven/prism.rb +1 -1
- data/lib/hecks/adapters/driven/sql_query_builder.rb +45 -53
- data/lib/hecks/adapters/driven/sql_value_members.rb +57 -0
- data/lib/hecks/adapters/driven/sqlite/codec.rb +32 -29
- data/lib/hecks/adapters/driven/sqlite/ddl.rb +68 -0
- data/lib/hecks/adapters/driven/sqlite/dialect.rb +55 -0
- data/lib/hecks/adapters/driven/sqlite/events.rb +61 -0
- data/lib/hecks/adapters/driven/sqlite/journal.rb +125 -0
- data/lib/hecks/adapters/driven/sqlite/outbox.rb +98 -0
- data/lib/hecks/adapters/driven/sqlite/projection.rb +82 -63
- data/lib/hecks/adapters/driven/sqlite/repository.rb +146 -0
- data/lib/hecks/adapters/driven/sqlite/sagas.rb +69 -0
- data/lib/hecks/adapters/driven/sqlite/schema_builder.rb +8 -55
- data/lib/hecks/adapters/driven/sqlite.rb +36 -513
- data/lib/hecks/adapters/driven/tenant_provisioner.rb +13 -7
- data/lib/hecks/adapters/driving/github_webhook.rb +11 -8
- data/lib/hecks/behaviors/dsl.rb +17 -12
- data/lib/hecks/behaviors/expectations/boot.rb +81 -0
- data/lib/hecks/behaviors/expectations/checks.rb +178 -0
- data/lib/hecks/behaviors/expectations/dispatching.rb +93 -0
- data/lib/hecks/behaviors/expectations/qualify.rb +81 -0
- data/lib/hecks/behaviors/expectations.rb +39 -355
- data/lib/hecks/behaviors/rspec.rb +12 -12
- data/lib/hecks/behaviors/runner.rb +20 -11
- data/lib/hecks/bench/cli.rb +16 -13
- data/lib/hecks/bench/environment.rb +1 -1
- data/lib/hecks/bench/report.rb +11 -7
- data/lib/hecks/bench/ruby_runner.rb +13 -8
- data/lib/hecks/bench/rust_runner.rb +19 -11
- data/lib/hecks/bench/suite.rb +48 -20
- data/lib/hecks/bench/workload.rb +42 -31
- data/lib/hecks/bluebook/aggregate.rb +15 -21
- data/lib/hecks/bluebook/assembly/aggregate_assembly.rb +18 -21
- data/lib/hecks/bluebook/assembly/build.rb +12 -7
- data/lib/hecks/bluebook/assembly/contracts/read_models.rb +70 -0
- data/lib/hecks/bluebook/assembly/contracts/rules.rb +84 -0
- data/lib/hecks/bluebook/assembly/contracts/sagas.rb +109 -0
- data/lib/hecks/bluebook/assembly/contracts/structure.rb +91 -0
- data/lib/hecks/bluebook/assembly/contracts.rb +9 -319
- data/lib/hecks/bluebook/assembly/marks.rb +9 -8
- data/lib/hecks/bluebook/attribute.rb +13 -10
- data/lib/hecks/bluebook/behaviour/aggregate.rb +10 -3
- data/lib/hecks/bluebook/behaviour/read_model.rb +26 -13
- data/lib/hecks/bluebook/chapter.rb +22 -14
- data/lib/hecks/bluebook/command.rb +14 -18
- data/lib/hecks/bluebook/domain_port.rb +11 -8
- data/lib/hecks/bluebook/dsl/aggregate_builder/correction_sealing.rb +78 -0
- data/lib/hecks/bluebook/dsl/aggregate_builder/draining.rb +74 -0
- data/lib/hecks/bluebook/dsl/aggregate_builder/query_field_sealing.rb +105 -0
- data/lib/hecks/bluebook/dsl/aggregate_builder/query_sealing.rb +121 -0
- data/lib/hecks/bluebook/dsl/aggregate_builder/relationships.rb +128 -0
- data/lib/hecks/bluebook/dsl/aggregate_builder/rules.rb +84 -0
- data/lib/hecks/bluebook/dsl/aggregate_builder/sealing.rb +61 -249
- data/lib/hecks/bluebook/dsl/aggregate_builder.rb +51 -285
- data/lib/hecks/bluebook/dsl/attribute_collector/identity_resolution.rb +113 -0
- data/lib/hecks/bluebook/dsl/attribute_collector.rb +58 -117
- data/lib/hecks/bluebook/dsl/binding_proxy.rb +24 -19
- data/lib/hecks/bluebook/dsl/bluebook_builder/pending_givens.rb +109 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/correlation_keys.rb +105 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/event_shapes.rb +126 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/hop_tails.rb +79 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/projected_fields.rb +76 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/provisions.rb +65 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/query_hops.rb +123 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/references.rb +112 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation/with_projections.rb +126 -0
- data/lib/hecks/bluebook/dsl/bluebook_builder/validation.rb +34 -595
- data/lib/hecks/bluebook/dsl/bluebook_builder.rb +18 -107
- data/lib/hecks/bluebook/dsl/command_builder/implicit_attributes.rb +132 -0
- data/lib/hecks/bluebook/dsl/command_builder/mutations.rb +190 -0
- data/lib/hecks/bluebook/dsl/command_builder/owner.rb +22 -0
- data/lib/hecks/bluebook/dsl/command_builder/rules.rb +57 -0
- data/lib/hecks/bluebook/dsl/command_builder.rb +60 -360
- data/lib/hecks/bluebook/dsl/domain_port_builder.rb +19 -13
- data/lib/hecks/bluebook/dsl/entity_builder/rules.rb +96 -0
- data/lib/hecks/bluebook/dsl/entity_builder/scope.rb +25 -0
- data/lib/hecks/bluebook/dsl/entity_builder/sealing.rb +94 -0
- data/lib/hecks/bluebook/dsl/entity_builder.rb +35 -169
- data/lib/hecks/bluebook/dsl/generic_dispatch.rb +53 -24
- data/lib/hecks/bluebook/dsl/hecksagon_builder/chapter_scope.rb +133 -0
- data/lib/hecks/bluebook/dsl/hecksagon_builder.rb +3 -97
- data/lib/hecks/bluebook/dsl/identity_declaration.rb +73 -73
- data/lib/hecks/bluebook/dsl/lifecycle_builder.rb +7 -3
- data/lib/hecks/bluebook/dsl/need_word.rb +1 -1
- data/lib/hecks/bluebook/dsl/port_operation_builder.rb +34 -29
- data/lib/hecks/bluebook/dsl/process_manager_builder.rb +57 -41
- data/lib/hecks/bluebook/dsl/query_builder.rb +12 -15
- data/lib/hecks/bluebook/dsl/read_model_builder/sealing.rb +116 -0
- data/lib/hecks/bluebook/dsl/read_model_builder.rb +25 -102
- data/lib/hecks/bluebook/dsl/rule_reference.rb +26 -12
- data/lib/hecks/bluebook/dsl/translation_builder.rb +24 -14
- data/lib/hecks/bluebook/dsl/value_object_builder.rb +29 -19
- data/lib/hecks/bluebook/dsl/word_gate.rb +34 -27
- data/lib/hecks/bluebook/entity.rb +13 -17
- data/lib/hecks/bluebook/expression/ast_json/emitters.rb +93 -0
- data/lib/hecks/bluebook/expression/ast_json/emitters.rb-e +88 -0
- data/lib/hecks/bluebook/expression/ast_json.rb +49 -76
- data/lib/hecks/bluebook/expression/ast_reader.rb +95 -28
- data/lib/hecks/bluebook/expression/canonical_form.rb +6 -26
- data/lib/hecks/bluebook/expression/evaluator/parser.rb +62 -0
- data/lib/hecks/bluebook/expression/evaluator/scanning.rb +122 -0
- data/lib/hecks/bluebook/expression/evaluator.rb +11 -111
- data/lib/hecks/bluebook/expression/resolver/block_predicates.rb +28 -44
- data/lib/hecks/bluebook/expression/resolver/lookups.rb +77 -0
- data/lib/hecks/bluebook/expression/resolver/operations.rb +78 -0
- data/lib/hecks/bluebook/expression/resolver/parsing.rb +110 -0
- data/lib/hecks/bluebook/expression/resolver/scanning.rb +139 -0
- data/lib/hecks/bluebook/expression/resolver/values.rb +115 -0
- data/lib/hecks/bluebook/expression/resolver.rb +16 -414
- data/lib/hecks/bluebook/{hexagon.rb → hecksagon.rb} +22 -14
- data/lib/hecks/bluebook/keyword_fields.rb +42 -0
- data/lib/hecks/bluebook/meta_validator/adapter_judge.rb +7 -6
- data/lib/hecks/bluebook/meta_validator/judge/cells.rb +99 -0
- data/lib/hecks/bluebook/meta_validator/judge/dispatching.rb +111 -0
- data/lib/hecks/bluebook/meta_validator/judge/identity.rb +108 -0
- data/lib/hecks/bluebook/meta_validator/judge/walking.rb +141 -0
- data/lib/hecks/bluebook/meta_validator/judge.rb +31 -376
- data/lib/hecks/bluebook/meta_validator/modes.rb +137 -0
- data/lib/hecks/bluebook/meta_validator/plan/category.rb +44 -0
- data/lib/hecks/bluebook/meta_validator/plan/verbs.rb +73 -0
- data/lib/hecks/bluebook/meta_validator/plan.rb +38 -122
- data/lib/hecks/bluebook/meta_validator/readings/fields.rb +100 -0
- data/lib/hecks/bluebook/meta_validator/readings.rb +10 -95
- data/lib/hecks/bluebook/meta_validator/reconstruction/heads.rb +89 -0
- data/lib/hecks/bluebook/meta_validator/reconstruction/reading.rb +96 -0
- data/lib/hecks/bluebook/meta_validator/reconstruction.rb +25 -151
- data/lib/hecks/bluebook/meta_validator/shapes/helpers.rb +83 -0
- data/lib/hecks/bluebook/meta_validator/shapes.rb +8 -75
- data/lib/hecks/bluebook/meta_validator/syntax_boot/disk_cache.rb +77 -0
- data/lib/hecks/bluebook/meta_validator/syntax_boot.rb +31 -95
- data/lib/hecks/bluebook/meta_validator/translation_judge/rules.rb +74 -0
- data/lib/hecks/bluebook/meta_validator/translation_judge.rb +15 -65
- data/lib/hecks/bluebook/meta_validator/verdict_cache/tagging.rb +63 -0
- data/lib/hecks/bluebook/meta_validator/verdict_cache.rb +22 -43
- data/lib/hecks/bluebook/meta_validator/world_judge.rb +8 -4
- data/lib/hecks/bluebook/meta_validator.rb +59 -175
- data/lib/hecks/bluebook/model_check/lifecycle_checks.rb +122 -0
- data/lib/hecks/bluebook/model_check/policy_checks.rb +129 -0
- data/lib/hecks/bluebook/model_check/saga_checks.rb +134 -0
- data/lib/hecks/bluebook/model_check/verbs.rb +69 -0
- data/lib/hecks/bluebook/model_check.rb +73 -413
- data/lib/hecks/bluebook/pattern_subset/refusals.rb +54 -0
- data/lib/hecks/bluebook/pattern_subset/scan.rb +58 -0
- data/lib/hecks/bluebook/pattern_subset.rb +93 -134
- data/lib/hecks/bluebook/process_manager.rb +10 -9
- data/lib/hecks/bluebook/project_discovery.rb +10 -7
- data/lib/hecks/bluebook/project_register.rb +42 -41
- data/lib/hecks/bluebook/query.rb +19 -12
- data/lib/hecks/bluebook/read_model.rb +41 -39
- data/lib/hecks/bluebook/smoke_test.rb +51 -36
- data/lib/hecks/bluebook/synthesizer.rb +13 -5
- data/lib/hecks/bluebook/translation.rb +12 -12
- data/lib/hecks/bluebook.rb +1 -1
- data/lib/hecks/chapters.rb +32 -16
- data/lib/hecks/cli/behaviors.rb +22 -15
- data/lib/hecks/cli/check_era.rb +2 -2
- data/lib/hecks/cli/command_table.rb +72 -0
- data/lib/hecks/cli/console.rb +10 -7
- data/lib/hecks/cli/deploy_template_diff.rb +22 -9
- data/lib/hecks/cli/document.rb +14 -10
- data/lib/hecks/cli/domain_stub.rb +1 -1
- data/lib/hecks/cli/domain_writer.rb +1 -1
- data/lib/hecks/cli/expression_projection.rb +8 -6
- data/lib/hecks/cli/follow.rb +10 -4
- data/lib/hecks/cli/interview_aggregate.rb +132 -0
- data/lib/hecks/cli/interview_draft.rb +16 -200
- data/lib/hecks/cli/interview_record.rb +130 -0
- data/lib/hecks/cli/interview_run.rb +19 -8
- data/lib/hecks/cli/interview_session/agent_state.rb +70 -0
- data/lib/hecks/cli/interview_session/catalog.rb +76 -0
- data/lib/hecks/cli/interview_session/manual_findings.rb +48 -0
- data/lib/hecks/cli/interview_session/proposals.rb +90 -0
- data/lib/hecks/cli/interview_session.rb +8 -205
- data/lib/hecks/cli/interview_shape.rb +13 -6
- data/lib/hecks/cli/ir.rb +8 -11
- data/lib/hecks/cli/launcher_words.rb +168 -0
- data/lib/hecks/cli/model_check/examination.rb +93 -0
- data/lib/hecks/cli/model_check/sources.rb +57 -0
- data/lib/hecks/cli/model_check.rb +28 -134
- data/lib/hecks/cli/project_cli/launcher_source.rb +177 -0
- data/lib/hecks/cli/project_cli/templates.rb +106 -0
- data/lib/hecks/cli/project_cli.rb +57 -236
- data/lib/hecks/cli/project_diagrams.rb +26 -4
- data/lib/hecks/cli/project_glossary.rb +19 -9
- data/lib/hecks/cli/refresh_rspec_runtime_baseline.rb +29 -13
- data/lib/hecks/cli/release.rb +29 -22
- data/lib/hecks/cli/release_gem.rb +12 -6
- data/lib/hecks/cli/rspec_io_parallel_files.rb +87 -30
- data/lib/hecks/cli/rspec_shard_files.rb +24 -9
- data/lib/hecks/cli/run.rb +25 -44
- data/lib/hecks/cli/run_expectations.rb +63 -0
- data/lib/hecks/cli/seed_semantics_corpus.rb +37 -17
- data/lib/hecks/cli/smoke_http/checks.rb +66 -0
- data/lib/hecks/cli/smoke_http/settings.rb +63 -0
- data/lib/hecks/cli/smoke_http/transport.rb +45 -0
- data/lib/hecks/cli/smoke_http.rb +8 -142
- data/lib/hecks/cli/smoke_test.rb +18 -4
- data/lib/hecks/cli/stores.rb +7 -4
- data/lib/hecks/cli/stress_concurrency_specs/reporting.rb +44 -0
- data/lib/hecks/cli/stress_concurrency_specs/usage.rb +28 -0
- data/lib/hecks/cli/stress_concurrency_specs.rb +82 -80
- data/lib/hecks/cli.rb +32 -208
- data/lib/hecks/codemod/runner.rb +92 -0
- data/lib/hecks/codemod/sweep.rb +94 -0
- data/lib/hecks/codemod.rb +22 -165
- data/lib/hecks/corpus/routes.rb +34 -0
- data/lib/hecks/corpus/rust.rb +193 -0
- data/lib/hecks/corpus/sources.rb +46 -0
- data/lib/hecks/corpus.rb +28 -265
- data/lib/hecks/deploy/bluebook/deploy.bluebook +1510 -3
- data/lib/hecks/deploy/bluebook/deploy.hecksagon +57 -0
- data/lib/hecks/deploy/oidc.json +225 -0
- data/lib/hecks/doc/reference/coverage.rb +70 -0
- data/lib/hecks/doc/reference/harvester.rb +55 -0
- data/lib/hecks/doc/reference/readme.rb +89 -0
- data/lib/hecks/doc/reference/rendering.rb +149 -0
- data/lib/hecks/doc/reference.rb +14 -273
- data/lib/hecks/doors/cli_door/nesting.rb +34 -0
- data/lib/hecks/doors/cli_door/shorthand.rb +85 -0
- data/lib/hecks/doors/cli_door.rb +23 -95
- data/lib/hecks/doors/cli_runner/answers.rb +138 -0
- data/lib/hecks/doors/cli_runner/resolution.rb +146 -0
- data/lib/hecks/doors/cli_runner/settling.rb +115 -0
- data/lib/hecks/doors/cli_runner/streaming.rb +90 -0
- data/lib/hecks/doors/cli_runner/suggestions.rb +43 -0
- data/lib/hecks/doors/cli_runner.rb +12 -336
- data/lib/hecks/doors/command_request.rb +42 -31
- data/lib/hecks/doors/handle.rb +32 -30
- data/lib/hecks/doors/launcher_options.rb +62 -7
- data/lib/hecks/doors/mcp_door/properties.rb +47 -0
- data/lib/hecks/doors/mcp_door/tool_calls.rb +113 -0
- data/lib/hecks/doors/mcp_door/tool_definitions/auditing.rb +51 -0
- data/lib/hecks/doors/mcp_door/tool_definitions/calling.rb +69 -0
- data/lib/hecks/doors/mcp_door/tool_definitions/reading.rb +97 -0
- data/lib/hecks/doors/mcp_door/tool_definitions.rb +15 -0
- data/lib/hecks/doors/mcp_door.rb +55 -301
- data/lib/hecks/doors/mcp_door_scope/argument_policy.rb +92 -0
- data/lib/hecks/doors/mcp_door_scope/env_problems.rb +55 -0
- data/lib/hecks/doors/mcp_door_scope/presenter.rb +78 -0
- data/lib/hecks/doors/mcp_door_scope.rb +16 -172
- data/lib/hecks/doors/ruby_door/aggregate_door.rb +1 -1
- data/lib/hecks/doors/ruby_door/chapter.rb +33 -16
- data/lib/hecks/doors/ruby_door.rb +14 -11
- data/lib/hecks/doors/usage_cache.rb +14 -8
- data/lib/hecks/doors.rb +10 -4
- data/lib/hecks/embryonaut_bluebook/manifest.rb +11 -3
- data/lib/hecks/embryonaut_bluebook/registry/changelog.rb +26 -0
- data/lib/hecks/embryonaut_bluebook/registry/versions.rb +27 -0
- data/lib/hecks/embryonaut_bluebook/registry.rb +27 -37
- data/lib/hecks/embryonaut_bluebook/vendor/acceptance.rb +37 -0
- data/lib/hecks/embryonaut_bluebook/vendor.rb +22 -36
- data/lib/hecks/embryonaut_bluebook/vendor_cli.rb +9 -6
- data/lib/hecks/embryonaut_bluebook.rb +16 -11
- data/lib/hecks/engine_agreement.rb +24 -17
- data/lib/hecks/forms/app/commands.rb +98 -0
- data/lib/hecks/forms/app/queries.rb +62 -0
- data/lib/hecks/forms/app/records.rb +67 -0
- data/lib/hecks/forms/app/responses.rb +46 -0
- data/lib/hecks/forms/app.rb +33 -221
- data/lib/hecks/forms/banking_presentation.rb +5 -0
- data/lib/hecks/forms/command_form_renderer.rb +55 -14
- data/lib/hecks/forms/field_controls.rb +95 -0
- data/lib/hecks/forms/field_renderer.rb +34 -88
- data/lib/hecks/forms/field_shape.rb +9 -34
- data/lib/hecks/forms/html.rb +1 -1
- data/lib/hecks/forms/index_renderer.rb +14 -9
- data/lib/hecks/forms/page.rb +2 -106
- data/lib/hecks/forms/page_assets.rb +88 -0
- data/lib/hecks/forms/page_script.rb +28 -0
- data/lib/hecks/forms/params.rb +17 -8
- data/lib/hecks/forms/query_form_renderer.rb +11 -7
- data/lib/hecks/forms/record_renderer.rb +28 -19
- data/lib/hecks/forms/reference_options.rb +1 -1
- data/lib/hecks/forms/text_shape.rb +40 -0
- data/lib/hecks/fqn.rb +64 -32
- data/lib/hecks/framework.rb +10 -3
- data/lib/hecks/freezer.rb +10 -1
- data/lib/hecks/fuzzing/bounded_exhaustive_expressions/fragments.rb +61 -0
- data/lib/hecks/fuzzing/bounded_exhaustive_expressions/productions.rb +217 -0
- data/lib/hecks/fuzzing/bounded_exhaustive_expressions.rb +5 -194
- data/lib/hecks/fuzzing/combination_miner.rb +23 -12
- data/lib/hecks/fuzzing/concurrent_dispatch/racing.rb +64 -0
- data/lib/hecks/fuzzing/concurrent_dispatch/world_copy.rb +66 -0
- data/lib/hecks/fuzzing/concurrent_dispatch.rb +31 -107
- data/lib/hecks/fuzzing/coverage_campaign.rb +7 -7
- data/lib/hecks/fuzzing/differential/wire_comparison.rb +74 -0
- data/lib/hecks/fuzzing/differential.rb +59 -84
- data/lib/hecks/fuzzing/domain_generator/block_rendering.rb +70 -0
- data/lib/hecks/fuzzing/domain_generator/builder/attribute_shapes.rb +105 -0
- data/lib/hecks/fuzzing/domain_generator/builder/shapes.rb +97 -0
- data/lib/hecks/fuzzing/domain_generator/builder/wiring.rb +128 -0
- data/lib/hecks/fuzzing/domain_generator/builder.rb +105 -0
- data/lib/hecks/fuzzing/domain_generator/pruning.rb +90 -0
- data/lib/hecks/fuzzing/domain_generator/removals.rb +62 -0
- data/lib/hecks/fuzzing/domain_generator/rendering.rb +94 -0
- data/lib/hecks/fuzzing/domain_generator/tokens.rb +38 -0
- data/lib/hecks/fuzzing/domain_generator.rb +7 -555
- data/lib/hecks/fuzzing/era_boundary.rb +34 -24
- data/lib/hecks/fuzzing/form_census.rb +18 -8
- data/lib/hecks/fuzzing/generated_domain_check.rb +23 -11
- data/lib/hecks/fuzzing/isolated_boot/copying.rb +62 -0
- data/lib/hecks/fuzzing/isolated_boot/postgres_scratch.rb +133 -0
- data/lib/hecks/fuzzing/isolated_boot/worlds.rb +102 -0
- data/lib/hecks/fuzzing/isolated_boot.rb +25 -252
- data/lib/hecks/fuzzing/persistence_parity.rb +5 -5
- data/lib/hecks/fuzzing/properties/aggregation_recompute.rb +121 -0
- data/lib/hecks/fuzzing/properties/catalog.rb +138 -0
- data/lib/hecks/fuzzing/properties/corrections.rb +23 -20
- data/lib/hecks/fuzzing/properties/dispatch_and_mutations.rb +64 -185
- data/lib/hecks/fuzzing/properties/group_by_recompute.rb +69 -0
- data/lib/hecks/fuzzing/properties/guards.rb +76 -108
- data/lib/hecks/fuzzing/properties/invariants_and_aggregation.rb +66 -227
- data/lib/hecks/fuzzing/properties/lifecycle_and_replay.rb +46 -35
- data/lib/hecks/fuzzing/properties/mutation_recompute.rb +162 -0
- data/lib/hecks/fuzzing/properties/outbox.rb +41 -24
- data/lib/hecks/fuzzing/properties/piece_invariants.rb +61 -0
- data/lib/hecks/fuzzing/properties/policy_wiring.rb +140 -0
- data/lib/hecks/fuzzing/properties/query_rows.rb +67 -0
- data/lib/hecks/fuzzing/properties/querying.rb +69 -90
- data/lib/hecks/fuzzing/properties/references.rb +100 -0
- data/lib/hecks/fuzzing/properties/tenant_scope.rb +84 -0
- data/lib/hecks/fuzzing/properties.rb +6 -119
- data/lib/hecks/fuzzing/qa_settings.rb +23 -17
- data/lib/hecks/fuzzing/replay/fan_out.rb +78 -0
- data/lib/hecks/fuzzing/replay/filters.rb +72 -0
- data/lib/hecks/fuzzing/replay/guard_check.rb +88 -0
- data/lib/hecks/fuzzing/replay/mutation_trace.rb +117 -0
- data/lib/hecks/fuzzing/replay/observation.rb +60 -0
- data/lib/hecks/fuzzing/replay/read_only_steps.rb +84 -0
- data/lib/hecks/fuzzing/replay/session.rb +151 -0
- data/lib/hecks/fuzzing/replay.rb +35 -442
- data/lib/hecks/fuzzing/rust_gap_manifest.rb +3 -4
- data/lib/hecks/fuzzing/self_consistency/saga_redelivery.rb +133 -0
- data/lib/hecks/fuzzing/self_consistency/sagas.rb +93 -0
- data/lib/hecks/fuzzing/self_consistency/value_objects.rb +87 -0
- data/lib/hecks/fuzzing/self_consistency.rb +8 -213
- data/lib/hecks/fuzzing/sequence_generator/adversary/argument_mutations.rb +116 -0
- data/lib/hecks/fuzzing/sequence_generator/adversary/caller_draw.rb +68 -0
- data/lib/hecks/fuzzing/sequence_generator/adversary/identity_mutations.rb +62 -0
- data/lib/hecks/fuzzing/sequence_generator/adversary/precedence_mutations.rb +126 -0
- data/lib/hecks/fuzzing/sequence_generator/adversary.rb +23 -283
- data/lib/hecks/fuzzing/sequence_generator/argument_drawing.rb +78 -0
- data/lib/hecks/fuzzing/sequence_generator/catalog.rb +69 -53
- data/lib/hecks/fuzzing/sequence_generator/identity_shaping.rb +85 -0
- data/lib/hecks/fuzzing/sequence_generator/outcome_tracker.rb +20 -16
- data/lib/hecks/fuzzing/sequence_generator/picker.rb +12 -6
- data/lib/hecks/fuzzing/sequence_generator/prefixing.rb +45 -0
- data/lib/hecks/fuzzing/sequence_generator/query_binding.rb +19 -8
- data/lib/hecks/fuzzing/sequence_generator/step_builder.rb +43 -144
- data/lib/hecks/fuzzing/sequence_generator.rb +65 -63
- data/lib/hecks/fuzzing/shrinker.rb +33 -29
- data/lib/hecks/fuzzing/target_capabilities.rb +10 -4
- data/lib/hecks/fuzzing/value_generator.rb +27 -17
- data/lib/hecks/gate/stages.yml +10 -0
- data/lib/hecks/grammar/evolve/arguments.rb +90 -0
- data/lib/hecks/grammar/evolve/keywords.rb +81 -0
- data/lib/hecks/grammar/evolve/seeds.rb +172 -0
- data/lib/hecks/grammar/evolve.rb +22 -263
- data/lib/hecks/grammar/operators.rb +111 -0
- data/lib/hecks/grammar.rb +53 -126
- data/lib/hecks/hecks/adapters/bluebook_report.rb +91 -0
- data/lib/hecks/hecks/adapters/codebase/codemods.rb +1 -1
- data/lib/hecks/hecks/adapters/codebase/corpus_tasks.rb +23 -9
- data/lib/hecks/hecks/adapters/codebase/language/edits.rb +75 -0
- data/lib/hecks/hecks/adapters/codebase/language.rb +30 -72
- data/lib/hecks/hecks/adapters/codebase/promotion/candidates.rb +54 -0
- data/lib/hecks/hecks/adapters/codebase/promotion/gate.rb +50 -0
- data/lib/hecks/hecks/adapters/codebase/promotion/move.rb +70 -0
- data/lib/hecks/hecks/adapters/codebase/promotion/standing.rb +88 -0
- data/lib/hecks/hecks/adapters/codebase/promotion/watch.rb +83 -0
- data/lib/hecks/hecks/adapters/codebase/promotion.rb +115 -0
- data/lib/hecks/hecks/adapters/codebase/publishing.rb +31 -12
- data/lib/hecks/hecks/adapters/codebase/regeneration.rb +43 -6
- data/lib/hecks/hecks/adapters/codebase/release_facts.rb +16 -5
- data/lib/hecks/hecks/adapters/codebase/source_tree.rb +9 -1
- data/lib/hecks/hecks/adapters/codebase/sqlite_fixture.rb +1 -1
- data/lib/hecks/hecks/adapters/codebase/style.rb +1 -1
- data/lib/hecks/hecks/adapters/codebase/test_runner.rb +11 -5
- data/lib/hecks/hecks/adapters/codebase/test_suite.rb +27 -8
- data/lib/hecks/hecks/adapters/console_capture.rb +21 -17
- data/lib/hecks/hecks/adapters/cost_explorer.rb +11 -6
- data/lib/hecks/hecks/adapters/deploy_plans.rb +49 -0
- data/lib/hecks/hecks/adapters/deploy_toolchain/answers.rb +141 -0
- data/lib/hecks/hecks/adapters/deploy_toolchain/scripts.rb +95 -0
- data/lib/hecks/hecks/adapters/deploy_toolchain/statuses.rb +74 -0
- data/lib/hecks/hecks/adapters/deploy_toolchain.rb +122 -59
- data/lib/hecks/hecks/adapters/finding_github.rb +2 -2
- data/lib/hecks/hecks/adapters/first_admin.rb +22 -8
- data/lib/hecks/hecks/adapters/git.rb +18 -5
- data/lib/hecks/hecks/adapters/git_refs.rb +144 -0
- data/lib/hecks/hecks/adapters/github_rulesets.rb +126 -0
- data/lib/hecks/hecks/adapters/host_http.rb +16 -6
- data/lib/hecks/hecks/adapters/in_process_boot.rb +9 -5
- data/lib/hecks/hecks/adapters/in_process_operations/tailing.rb +61 -0
- data/lib/hecks/hecks/adapters/in_process_operations.rb +39 -37
- data/lib/hecks/hecks/adapters/journal_store/changes.rb +21 -15
- data/lib/hecks/hecks/adapters/journal_store/edge_audit.rb +29 -12
- data/lib/hecks/hecks/adapters/journal_store/readings/attestation.rb +52 -0
- data/lib/hecks/hecks/adapters/journal_store/readings/scaffolding.rb +52 -0
- data/lib/hecks/hecks/adapters/journal_store/readings.rb +5 -62
- data/lib/hecks/hecks/adapters/local_files.rb +27 -10
- data/lib/hecks/hecks/adapters/pg_admin/ownership.rb +115 -0
- data/lib/hecks/hecks/adapters/pg_admin.rb +14 -87
- data/lib/hecks/hecks/adapters/process_pool.rb +54 -22
- data/lib/hecks/hecks/adapters/rust_toolchain.rb +12 -4
- data/lib/hecks/hecks/adapters/site_toolchain.rb +19 -10
- data/lib/hecks/hecks/adapters/terminal.rb +13 -9
- data/lib/hecks/hecks/codebase.bluebook +322 -5
- data/lib/hecks/hecks/custodian.bluebook +12 -2
- data/lib/hecks/hecks/hecks.hecksagon +73 -0
- data/lib/hecks/hecks/hecks.world +15 -3
- data/lib/hecks/kernel_capabilities/templates.rb +92 -0
- data/lib/hecks/kernel_capabilities.rb +18 -85
- data/lib/hecks/language/bluebook/vocabulary.bluebook +43 -1
- data/lib/hecks/literal/item_splitter.rb +50 -0
- data/lib/hecks/literal.rb +29 -38
- data/lib/hecks/mcp_stdio_guard.rb +8 -8
- data/lib/hecks/naming.rb +9 -3
- data/lib/hecks/persistence_legacy_fixture/postgres_stores.rb +81 -0
- data/lib/hecks/persistence_legacy_fixture/regenerate.rb +26 -66
- data/lib/hecks/persistence_legacy_fixture.rb +13 -10
- data/lib/hecks/ports/access_control.rb +13 -10
- data/lib/hecks/ports/agent/answers.rb +2 -2
- data/lib/hecks/ports/agent.rb +13 -10
- data/lib/hecks/ports/authentication.rb +13 -10
- data/lib/hecks/ports/authorization.rb +13 -10
- data/lib/hecks/ports/clock.rb +13 -10
- data/lib/hecks/ports/extraction.rb +13 -12
- data/lib/hecks/ports/identity_assignment.rb +13 -10
- data/lib/hecks/ports/identity_generation.rb +13 -10
- data/lib/hecks/ports/identity_resolution.rb +13 -10
- data/lib/hecks/ports/key_vault.rb +13 -10
- data/lib/hecks/ports/persistence/append_only.rb +5 -5
- data/lib/hecks/ports/persistence/binding_policy.rb +33 -9
- data/lib/hecks/ports/persistence/codec_boundary.rb +22 -11
- data/lib/hecks/ports/persistence/constants.rb +10 -0
- data/lib/hecks/ports/persistence/plugins/era/era_check.rb +18 -16
- data/lib/hecks/ports/persistence/plugins/era/era_guard/shape_diff.rb +27 -18
- data/lib/hecks/ports/persistence/plugins/era/era_guard.rb +52 -23
- data/lib/hecks/ports/persistence/plugins/era/era_tamper.rb +14 -8
- data/lib/hecks/ports/persistence/plugins/era/expected_era.rb +17 -6
- data/lib/hecks/ports/persistence/plugins/era/lineage/coverage.rb +58 -0
- data/lib/hecks/ports/persistence/plugins/era/lineage/rewrite.rb +130 -0
- data/lib/hecks/ports/persistence/plugins/era/lineage/rules.rb +25 -0
- data/lib/hecks/ports/persistence/plugins/era/lineage.rb +20 -180
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/boot.rb +41 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/class_methods.rb +105 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/dialect.rb +137 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/events.rb +25 -28
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/head_writes.rb +62 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/journal.rb +128 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/base_sql.rb +74 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/chain_sql.rb +169 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/domain_rename.rb +91 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/era_integrity.rb +99 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/era_store.rb +0 -73
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/field_cache.rb +55 -39
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/head_compiler.rb +51 -222
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/merge_writes.rb +120 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/mint_transaction.rb +85 -60
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/provisioning.rb +97 -181
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/resumable_backfill.rb +19 -19
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/sql_templates.rb +88 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/tail_merge.rb +77 -118
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/transform_installer.rb +3 -117
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage/transform_sql.rb +116 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage.rb +3 -1
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/context.rb +38 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/coverage_check.rb +43 -25
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/era_resolver.rb +62 -38
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/merge_coordinator.rb +21 -16
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/minter.rb +66 -86
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager/refusals.rb +75 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/lineage_manager.rb +27 -9
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/query_phases.rb +63 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era/sagas.rb +78 -0
- data/lib/hecks/ports/persistence/plugins/era/postgres_era.rb +28 -482
- data/lib/hecks/ports/persistence/plugins/era/translation/approval_file.rb +40 -12
- data/lib/hecks/ports/persistence/plugins/era/translation/audit/layer_one.rb +22 -15
- data/lib/hecks/ports/persistence/plugins/era/translation/audit/layer_two.rb +39 -19
- data/lib/hecks/ports/persistence/plugins/era/translation/audit/unfed_report.rb +16 -16
- data/lib/hecks/ports/persistence/plugins/era/translation/rule_compiler.rb +48 -25
- data/lib/hecks/ports/persistence/plugins/era/translation/scaffold/differ.rb +60 -99
- data/lib/hecks/ports/persistence/plugins/era/translation/scaffold/path_diff.rb +57 -0
- data/lib/hecks/ports/persistence/plugins/era/translation/scaffold/renderer.rb +21 -11
- data/lib/hecks/ports/persistence/plugins/era/translation/scaffold/writer.rb +13 -4
- data/lib/hecks/ports/persistence/postgres_dump/connection.rb +4 -2
- data/lib/hecks/ports/persistence/postgres_dump.rb +13 -7
- data/lib/hecks/ports/persistence/repository_factory.rb +35 -11
- data/lib/hecks/ports/persistence/state_codec.rb +10 -0
- data/lib/hecks/ports/persistence.rb +1 -10
- data/lib/hecks/ports/projection.rb +34 -21
- data/lib/hecks/ports/query/in_memory.rb +16 -8
- data/lib/hecks/projection_files/expression_tables.rb +64 -0
- data/lib/hecks/projection_files/texts.rb +67 -0
- data/lib/hecks/projection_files.rb +19 -103
- data/lib/hecks/projections/bootstrap_table.rb +43 -29
- data/lib/hecks/projections/deploy/bastion_lines.rb +32 -0
- data/lib/hecks/projections/deploy/box/access.rb +73 -0
- data/lib/hecks/projections/deploy/box/caddy.rb +87 -0
- data/lib/hecks/projections/deploy/box/compose.rb +70 -0
- data/lib/hecks/projections/deploy/box/hosting.rb +16 -108
- data/lib/hecks/projections/deploy/box/hosting_parts.rb +97 -0
- data/lib/hecks/projections/deploy/box/hosting_settings.rb +1 -1
- data/lib/hecks/projections/deploy/box/roll_recipe.rb +62 -0
- data/lib/hecks/projections/deploy/box/roll_scripts.rb +135 -0
- data/lib/hecks/projections/deploy/box/settings/checks.rb +38 -0
- data/lib/hecks/projections/deploy/box/settings/containers.rb +123 -0
- data/lib/hecks/projections/deploy/box/settings/origin.rb +56 -0
- data/lib/hecks/projections/deploy/box/settings/patterns.rb +43 -0
- data/lib/hecks/projections/deploy/box/settings/types.rb +72 -0
- data/lib/hecks/projections/deploy/box/settings.rb +58 -263
- data/lib/hecks/projections/deploy/box/stack_yaml.rb +107 -0
- data/lib/hecks/projections/deploy/box/templates/MIGRATION.md.tmpl +39 -0
- data/lib/hecks/projections/deploy/box/templates/Makefile.tmpl +24 -0
- data/lib/hecks/projections/deploy/box/templates/deploy-box.sh.tmpl +51 -4
- data/lib/hecks/projections/deploy/box/templates/deploy-service.services-roll.part +4 -3
- data/lib/hecks/projections/deploy/box/templates/deploy-service.sh.tmpl +16 -4
- data/lib/hecks/projections/deploy/box/templates/deploy-service.taskdef-roll.part +8 -7
- data/lib/hecks/projections/deploy/box/templates/deploy-service.taskdef.part +1 -1
- data/lib/hecks/projections/deploy/box/templates/deploy-usage-services.tmpl +4 -0
- data/lib/hecks/projections/deploy/box/templates/deploy-usage-taskdef.tmpl +5 -0
- data/lib/hecks/projections/deploy/box/templates/ecr-repository.yaml.tmpl +9 -0
- data/lib/hecks/projections/deploy/box/templates/hosting.mk.tmpl +6 -3
- data/lib/hecks/projections/deploy/box/templates/mode-summary-services.tmpl +2 -0
- data/lib/hecks/projections/deploy/box/templates/mode-summary-taskdef.tmpl +4 -0
- data/lib/hecks/projections/deploy/box/templates/restore-to-rds.sh.tmpl +8 -3
- data/lib/hecks/projections/deploy/box/templates/services-block.tmpl +9 -0
- data/lib/hecks/projections/deploy/box/templates/tunnel-egress.yaml.tmpl +11 -0
- data/lib/hecks/projections/deploy/box/templates/verify-copy.sh.tmpl +2 -2
- data/lib/hecks/projections/deploy/box/templates/writable-secrets.yaml.tmpl +7 -0
- data/lib/hecks/projections/deploy/box.rb +37 -503
- data/lib/hecks/projections/deploy/fargate/assembly.rb +13 -142
- data/lib/hecks/projections/deploy/fargate/cdn/behaviors.rb +76 -0
- data/lib/hecks/projections/deploy/fargate/cdn/lines.rb +112 -0
- data/lib/hecks/projections/deploy/fargate/cdn/options.rb +85 -0
- data/lib/hecks/projections/deploy/fargate/cdn.rb +23 -215
- data/lib/hecks/projections/deploy/fargate/check.rb +16 -6
- data/lib/hecks/projections/deploy/fargate/containers/definition_lines.rb +61 -0
- data/lib/hecks/projections/deploy/fargate/containers/reading.rb +86 -0
- data/lib/hecks/projections/deploy/fargate/containers/rendering.rb +132 -0
- data/lib/hecks/projections/deploy/fargate/containers/routing.rb +93 -0
- data/lib/hecks/projections/deploy/fargate/containers.rb +10 -286
- data/lib/hecks/projections/deploy/fargate/extras/reading.rb +90 -0
- data/lib/hecks/projections/deploy/fargate/extras/rendering.rb +81 -0
- data/lib/hecks/projections/deploy/fargate/extras.rb +9 -158
- data/lib/hecks/projections/deploy/fargate/monitoring/alarms.rb +115 -0
- data/lib/hecks/projections/deploy/fargate/monitoring/reading.rb +84 -0
- data/lib/hecks/projections/deploy/fargate/monitoring/topic.rb +59 -0
- data/lib/hecks/projections/deploy/fargate/monitoring/warmer.rb +90 -0
- data/lib/hecks/projections/deploy/fargate/monitoring/warmer_roles.rb +76 -0
- data/lib/hecks/projections/deploy/fargate/monitoring.rb +14 -348
- data/lib/hecks/projections/deploy/fargate/sections.rb +115 -0
- data/lib/hecks/projections/deploy/fargate/settings/ids.rb +55 -0
- data/lib/hecks/projections/deploy/fargate/settings/tuning.rb +77 -0
- data/lib/hecks/projections/deploy/fargate/settings.rb +17 -104
- data/lib/hecks/projections/deploy/fargate/stack/blocks.rb +91 -0
- data/lib/hecks/projections/deploy/fargate/stack/readers.rb +87 -0
- data/lib/hecks/projections/deploy/fargate/stack/recipes.rb +106 -0
- data/lib/hecks/projections/deploy/fargate/stack.rb +146 -0
- data/lib/hecks/projections/deploy/fargate/task_sections.rb +56 -0
- data/lib/hecks/projections/deploy/fargate/yaml.rb +1 -1
- data/lib/hecks/projections/deploy/fargate.rb +51 -756
- data/lib/hecks/projections/deploy/lambda/pii.rb +49 -0
- data/lib/hecks/projections/deploy/lambda/stack/blocks.rb +118 -0
- data/lib/hecks/projections/deploy/lambda/stack/checks.rb +64 -0
- data/lib/hecks/projections/deploy/lambda/stack/deploy_chain.rb +119 -0
- data/lib/hecks/projections/deploy/lambda/stack/readers.rb +62 -0
- data/lib/hecks/projections/deploy/lambda/stack/reading.rb +170 -0
- data/lib/hecks/projections/deploy/lambda/stack/reading_web.rb +53 -0
- data/lib/hecks/projections/deploy/lambda/stack/recipes.rb +112 -0
- data/lib/hecks/projections/deploy/lambda/stack/web.rb +57 -0
- data/lib/hecks/projections/deploy/lambda/stack.rb +54 -0
- data/lib/hecks/projections/deploy/lambda.rb +77 -1885
- data/lib/hecks/projections/deploy/preview/access_yaml.rb +8 -74
- data/lib/hecks/projections/deploy/preview/containers.rb +18 -7
- data/lib/hecks/projections/deploy/preview/routing_yaml.rb +15 -87
- data/lib/hecks/projections/deploy/preview/settings.rb +7 -4
- data/lib/hecks/projections/deploy/preview/task_yaml.rb +42 -106
- data/lib/hecks/projections/deploy/preview/template.rb +11 -106
- data/lib/hecks/projections/deploy/preview/yaml_text.rb +1 -1
- data/lib/hecks/projections/deploy/scripts/hosting.mk.tmpl +1 -1
- data/lib/hecks/projections/deploy/scripts/settings.rb +14 -6
- data/lib/hecks/projections/deploy/scripts.rb +11 -9
- data/lib/hecks/projections/deploy/shared/rows.rb +48 -0
- data/lib/hecks/projections/deploy/shared.rb +89 -449
- data/lib/hecks/projections/deploy/smoke.rb +15 -10
- data/lib/hecks/projections/deploy/template_diff/comparer.rb +21 -147
- data/lib/hecks/projections/deploy/template_diff/normalizer.rb +60 -0
- data/lib/hecks/projections/deploy/template_diff/value_diff.rb +136 -0
- data/lib/hecks/projections/deploy/template_diff.rb +8 -3
- data/lib/hecks/projections/deploy/templates/fargate/Dockerfile.tmpl +28 -0
- data/lib/hecks/projections/deploy/templates/fargate/Makefile.tmpl +63 -0
- data/lib/hecks/projections/deploy/templates/fargate/always_params.tmpl +4 -0
- data/lib/hecks/projections/deploy/templates/fargate/deploy_plain.tmpl +1 -0
- data/lib/hecks/projections/deploy/templates/fargate/deploy_shared.tmpl +11 -0
- data/lib/hecks/projections/deploy/templates/fargate/mint_era_own.tmpl +44 -0
- data/lib/hecks/projections/deploy/templates/fargate/mint_era_shared.tmpl +8 -0
- data/lib/hecks/projections/deploy/templates/fargate/missing_owner.tmpl +9 -0
- data/lib/hecks/projections/deploy/templates/fargate/oauth_params.tmpl +7 -0
- data/lib/hecks/projections/deploy/templates/fargate/oauth_task_env.tmpl +4 -0
- data/lib/hecks/projections/deploy/templates/fargate/oauth_task_policy.tmpl +7 -0
- data/lib/hecks/projections/deploy/templates/fargate/owning_params.tmpl +33 -0
- data/lib/hecks/projections/deploy/templates/fargate/template.yaml.tmpl +281 -0
- data/lib/hecks/projections/deploy/templates/lambda/Makefile.tmpl +218 -0
- data/lib/hecks/projections/deploy/templates/lambda/aurora_depends.tmpl +18 -0
- data/lib/hecks/projections/deploy/templates/lambda/build_dispatch_none.tmpl +10 -0
- data/lib/hecks/projections/deploy/templates/lambda/build_pg.tmpl +15 -0
- data/lib/hecks/projections/deploy/templates/lambda/build_plain.tmpl +2 -0
- data/lib/hecks/projections/deploy/templates/lambda/build_web.tmpl +11 -0
- data/lib/hecks/projections/deploy/templates/lambda/env_blind_guard.tmpl +4 -0
- data/lib/hecks/projections/deploy/templates/lambda/mint_era_own.tmpl +122 -0
- data/lib/hecks/projections/deploy/templates/lambda/mint_era_shared.tmpl +47 -0
- data/lib/hecks/projections/deploy/templates/lambda/missing_owner.tmpl +9 -0
- data/lib/hecks/projections/deploy/templates/lambda/nat_comment_oauth.tmpl +14 -0
- data/lib/hecks/projections/deploy/templates/lambda/nat_comment_plain.tmpl +3 -0
- data/lib/hecks/projections/deploy/templates/lambda/oauth_note.tmpl +8 -0
- data/lib/hecks/projections/deploy/templates/lambda/params_oauth.tmpl +13 -0
- data/lib/hecks/projections/deploy/templates/lambda/params_shared.tmpl +33 -0
- data/lib/hecks/projections/deploy/templates/lambda/pg_native.tmpl +71 -0
- data/lib/hecks/projections/deploy/templates/lambda/pii_oac.tmpl +8 -0
- data/lib/hecks/projections/deploy/templates/lambda/pii_permission.tmpl +8 -0
- data/lib/hecks/projections/deploy/templates/lambda/pii_resources.tmpl +116 -0
- data/lib/hecks/projections/deploy/templates/lambda/predeploy_bridge.tmpl +30 -0
- data/lib/hecks/projections/deploy/templates/lambda/predeploy_bridge_oauth.tmpl +12 -0
- data/lib/hecks/projections/deploy/templates/lambda/predeploy_bridge_plain.tmpl +7 -0
- data/lib/hecks/projections/deploy/templates/lambda/rename_schema_own.tmpl +93 -0
- data/lib/hecks/projections/deploy/templates/lambda/rename_schema_shared.tmpl +7 -0
- data/lib/hecks/projections/deploy/templates/lambda/rust_oauth_env.tmpl +17 -0
- data/lib/hecks/projections/deploy/templates/lambda/rust_oauth_policy.tmpl +16 -0
- data/lib/hecks/projections/deploy/templates/lambda/rust_session_secret.tmpl +13 -0
- data/lib/hecks/projections/deploy/templates/lambda/samconfig.toml.tmpl +12 -0
- data/lib/hecks/projections/deploy/templates/lambda/shared_note.tmpl +6 -0
- data/lib/hecks/projections/deploy/templates/lambda/sync_oauth.tmpl +23 -0
- data/lib/hecks/projections/deploy/templates/lambda/template.yaml.tmpl +187 -0
- data/lib/hecks/projections/deploy/templates/lambda/translation_own.tmpl +46 -0
- data/lib/hecks/projections/deploy/templates/lambda/translation_shared.tmpl +2 -0
- data/lib/hecks/projections/deploy/templates/lambda/web_function.tmpl +207 -0
- data/lib/hecks/projections/deploy/templates/lambda/web_google_oauth_env.tmpl +12 -0
- data/lib/hecks/projections/deploy/templates/lambda/web_no_oauth_env.tmpl +7 -0
- data/lib/hecks/projections/deploy/templates/lambda/web_oauth_policy.tmpl +4 -0
- data/lib/hecks/projections/deploy/templates/lambda/webhook_secret_resource.tmpl +20 -0
- data/lib/hecks/projections/deploy/templates/preview/alb.tmpl +8 -0
- data/lib/hecks/projections/deploy/templates/preview/alb_security_group.tmpl +11 -0
- data/lib/hecks/projections/deploy/templates/preview/assume_role.tmpl +6 -0
- data/lib/hecks/projections/deploy/templates/preview/base_parameters.tmpl +24 -0
- data/lib/hecks/projections/deploy/templates/preview/cluster.tmpl +4 -0
- data/lib/hecks/projections/deploy/templates/preview/container_secret.tmpl +9 -0
- data/lib/hecks/projections/deploy/templates/preview/db_init_script.sh.tmpl +23 -0
- data/lib/hecks/projections/deploy/templates/preview/db_init_secrets.tmpl +5 -0
- data/lib/hecks/projections/deploy/templates/preview/db_init_task.tmpl +39 -0
- data/lib/hecks/projections/deploy/templates/preview/desired_count.tmpl +5 -0
- data/lib/hecks/projections/deploy/templates/preview/distribution.tmpl +24 -0
- data/lib/hecks/projections/deploy/templates/preview/execution_role.tmpl +16 -0
- data/lib/hecks/projections/deploy/templates/preview/header.tmpl +16 -0
- data/lib/hecks/projections/deploy/templates/preview/ingress.tmpl +8 -0
- data/lib/hecks/projections/deploy/templates/preview/listener.tmpl +9 -0
- data/lib/hecks/projections/deploy/templates/preview/listener_rule.tmpl +11 -0
- data/lib/hecks/projections/deploy/templates/preview/log_group.tmpl +5 -0
- data/lib/hecks/projections/deploy/templates/preview/log_options.tmpl +5 -0
- data/lib/hecks/projections/deploy/templates/preview/outputs.tmpl +14 -0
- data/lib/hecks/projections/deploy/templates/preview/service.tmpl +17 -0
- data/lib/hecks/projections/deploy/templates/preview/session_secret.tmpl +11 -0
- data/lib/hecks/projections/deploy/templates/preview/target_group.tmpl +9 -0
- data/lib/hecks/projections/deploy/templates/preview/task_definition.tmpl +15 -0
- data/lib/hecks/projections/deploy/templates/preview/task_role.tmpl +22 -0
- data/lib/hecks/projections/deploy/templates/shared/aurora_db.tmpl +52 -0
- data/lib/hecks/projections/deploy/templates/shared/bastion.tmpl +74 -0
- data/lib/hecks/projections/deploy/templates/shared/bastion_own_public.tmpl +41 -0
- data/lib/hecks/projections/deploy/templates/shared/bastion_reuse_public.tmpl +10 -0
- data/lib/hecks/projections/deploy/templates/shared/nat_gateway.tmpl +102 -0
- data/lib/hecks/projections/deploy/templates/shared/oauth_egress.tmpl +17 -0
- data/lib/hecks/projections/deploy/templates/shared/plain_db.tmpl +16 -0
- data/lib/hecks/projections/deploy/templates/shared/vpc_and_database.tmpl +67 -0
- data/lib/hecks/projections/deploy/text_template.rb +35 -0
- data/lib/hecks/projections/diagrams/dispatch.rb +114 -0
- data/lib/hecks/projections/diagrams/statecharts.rb +59 -0
- data/lib/hecks/projections/diagrams/structure.rb +114 -0
- data/lib/hecks/projections/diagrams.rb +33 -256
- data/lib/hecks/projections/glossary/entries.rb +140 -0
- data/lib/hecks/projections/glossary/html/page.rb +96 -0
- data/lib/hecks/projections/glossary/html/parser.rb +66 -0
- data/lib/hecks/projections/glossary/html/sections.rb +78 -0
- data/lib/hecks/projections/glossary/html.rb +7 -179
- data/lib/hecks/projections/glossary/index.rb +45 -0
- data/lib/hecks/projections/glossary/markdown.rb +22 -11
- data/lib/hecks/projections/glossary/mermaid.rb +44 -31
- data/lib/hecks/projections/glossary/sensitivity.rb +7 -4
- data/lib/hecks/projections/glossary/sentences/value_objects.rb +77 -0
- data/lib/hecks/projections/glossary/sentences.rb +42 -81
- data/lib/hecks/projections/glossary/slugs.rb +33 -0
- data/lib/hecks/projections/glossary.rb +22 -190
- data/lib/hecks/projections/model.rb +20 -14
- data/lib/hecks/projections/rust_vocabulary/arguments/support.rb +33 -0
- data/lib/hecks/projections/rust_vocabulary/arguments.rb +171 -0
- data/lib/hecks/projections/rust_vocabulary/enum_body.rb +114 -0
- data/lib/hecks/projections/rust_vocabulary/tests.rb +144 -0
- data/lib/hecks/projections/rust_vocabulary.rb +24 -293
- data/lib/hecks/projections/site/admin.rb +146 -0
- data/lib/hecks/projections/site/admin_cms/templates/membership.rb +115 -0
- data/lib/hecks/projections/site/admin_cms/templates/session_strategy.rb +90 -0
- data/lib/hecks/projections/site/admin_cms/templates/sso.rb +101 -0
- data/lib/hecks/projections/site/admin_cms/templates/sso_tail.rb +54 -0
- data/lib/hecks/projections/site/admin_cms/templates/users.rb +83 -0
- data/lib/hecks/projections/site/admin_cms/templates.rb +33 -0
- data/lib/hecks/projections/site/admin_cms.rb +78 -0
- data/lib/hecks/projections/site/edge/behaviours.rb +10 -6
- data/lib/hecks/projections/site/edge/checks.rb +30 -80
- data/lib/hecks/projections/site/edge/findings.rb +28 -0
- data/lib/hecks/projections/site/edge/route_checks.rb +110 -0
- data/lib/hecks/projections/site/edge/row_reader.rb +52 -0
- data/lib/hecks/projections/site/edge/rules.rb +28 -26
- data/lib/hecks/projections/site/edge.rb +20 -31
- data/lib/hecks/projections/site/live_edge.rb +9 -7
- data/lib/hecks/projections/site/payload/fields/definitions.rb +90 -0
- data/lib/hecks/projections/site/payload/fields/readers.rb +69 -0
- data/lib/hecks/projections/site/payload/fields.rb +137 -0
- data/lib/hecks/projections/site/payload/lifecycle/text.rb +84 -0
- data/lib/hecks/projections/site/payload/lifecycle/text_tail.rb +106 -0
- data/lib/hecks/projections/site/payload/lifecycle.rb +33 -0
- data/lib/hecks/projections/site/payload/model.rb +128 -0
- data/lib/hecks/projections/site/payload/specs/wire.rb +69 -0
- data/lib/hecks/projections/site/payload/specs.rb +135 -0
- data/lib/hecks/projections/site/payload_driver.rb +95 -0
- data/lib/hecks/projections/site/root_rows.rb +67 -0
- data/lib/hecks/projections/site/routes_ts/helpers.rb +79 -0
- data/lib/hecks/projections/site/routes_ts/listings.rb +75 -0
- data/lib/hecks/projections/site/routes_ts/navigation.rb +79 -0
- data/lib/hecks/projections/site/routes_ts.rb +27 -175
- data/lib/hecks/projections/site/site_admin/access.rb +104 -0
- data/lib/hecks/projections/site/site_admin/session.rb +127 -0
- data/lib/hecks/projections/site/site_admin.rb +85 -0
- data/lib/hecks/projections/site/site_cdn.rb +12 -7
- data/lib/hecks/projections/site/site_host/dockerfile.rb +75 -0
- data/lib/hecks/projections/site/site_host/templates.rb +109 -0
- data/lib/hecks/projections/site/site_host.rb +58 -0
- data/lib/hecks/projections/site/site_root/workflow.rb +65 -0
- data/lib/hecks/projections/site/site_root.rb +128 -0
- data/lib/hecks/projections/site/table/checks.rb +28 -57
- data/lib/hecks/projections/site/table/link_builder.rb +14 -5
- data/lib/hecks/projections/site/table/navigation_checks.rb +75 -0
- data/lib/hecks/projections/site/table/row_builder.rb +31 -53
- data/lib/hecks/projections/site/table/row_defaults.rb +65 -0
- data/lib/hecks/projections/site/table.rb +9 -5
- data/lib/hecks/projections/vocabulary.rb +34 -31
- data/lib/hecks/projector/cli_audience.rb +42 -0
- data/lib/hecks/projector/cli_projector/claims.rb +149 -0
- data/lib/hecks/projector/cli_projector/command_help.rb +65 -0
- data/lib/hecks/projector/cli_projector/command_specs.rb +133 -0
- data/lib/hecks/projector/cli_projector/listing.rb +100 -0
- data/lib/hecks/projector/cli_projector/option_specs.rb +116 -0
- data/lib/hecks/projector/cli_projector/query_specs.rb +67 -0
- data/lib/hecks/projector/cli_projector/usage.rb +101 -0
- data/lib/hecks/projector/cli_projector.rb +15 -532
- data/lib/hecks/projector/docs_projector/attributes.rb +78 -0
- data/lib/hecks/projector/docs_projector/behaviour.rb +127 -0
- data/lib/hecks/projector/docs_projector/closing.rb +40 -0
- data/lib/hecks/projector/docs_projector.rb +58 -192
- data/lib/hecks/projector/exporter/bindings.rb +174 -0
- data/lib/hecks/projector/exporter/translations.rb +127 -0
- data/lib/hecks/projector/exporter.rb +8 -279
- data/lib/hecks/projector/narrate_projector/commands.rb +108 -0
- data/lib/hecks/projector/narrate_projector/reactions.rb +33 -0
- data/lib/hecks/projector/narrate_projector.rb +60 -160
- data/lib/hecks/projector.rb +22 -13
- data/lib/hecks/quality_control/adapters/agent_profile.rb +25 -16
- data/lib/hecks/quality_control/adapters/github_checks.rb +42 -6
- data/lib/hecks/quality_control/adapters/github_ci_webhook.rb +1 -1
- data/lib/hecks/quality_control/adapters/github_issues.rb +22 -10
- data/lib/hecks/quality_control/cli/qa_discover_external_domains/parsing.rb +54 -0
- data/lib/hecks/quality_control/cli/qa_discover_external_domains/reporting.rb +44 -0
- data/lib/hecks/quality_control/cli/qa_discover_external_domains/scanning.rb +119 -0
- data/lib/hecks/quality_control/cli/qa_discover_external_domains.rb +28 -155
- data/lib/hecks/quality_control/cli/qa_domain_novelty/verdict.rb +76 -0
- data/lib/hecks/quality_control/cli/qa_domain_novelty.rb +33 -66
- data/lib/hecks/quality_control/cli/qa_generated_domains/arguments.rb +62 -0
- data/lib/hecks/quality_control/cli/qa_generated_domains/blueprints.rb +45 -0
- data/lib/hecks/quality_control/cli/qa_generated_domains/evaluation.rb +107 -0
- data/lib/hecks/quality_control/cli/qa_generated_domains/promotion.rb +107 -0
- data/lib/hecks/quality_control/cli/qa_generated_domains/reporting.rb +97 -0
- data/lib/hecks/quality_control/cli/qa_generated_domains/shrinking.rb +70 -0
- data/lib/hecks/quality_control/cli/qa_generated_domains.rb +43 -327
- data/lib/hecks/quality_control/cli/qa_log_bug/arguments.rb +55 -0
- data/lib/hecks/quality_control/cli/qa_log_bug/proof.rb +65 -0
- data/lib/hecks/quality_control/cli/qa_log_bug.rb +18 -81
- data/lib/hecks/quality_control/cli/qa_mine_combinations/arguments.rb +54 -0
- data/lib/hecks/quality_control/cli/qa_mine_combinations/booting.rb +96 -0
- data/lib/hecks/quality_control/cli/qa_mine_combinations.rb +45 -109
- data/lib/hecks/quality_control/cli/qa_open_pr/arguments.rb +55 -0
- data/lib/hecks/quality_control/cli/qa_open_pr/recording.rb +79 -0
- data/lib/hecks/quality_control/cli/qa_open_pr/rules.rb +122 -0
- data/lib/hecks/quality_control/cli/qa_open_pr.rb +41 -200
- data/lib/hecks/quality_control/cli/qa_postgres_migrate/copying.rb +45 -0
- data/lib/hecks/quality_control/cli/qa_postgres_migrate/reporting.rb +33 -0
- data/lib/hecks/quality_control/cli/qa_postgres_migrate.rb +37 -63
- data/lib/hecks/quality_control/cli/qa_postgres_role/ownership.rb +57 -0
- data/lib/hecks/quality_control/cli/qa_postgres_role.rb +66 -71
- data/lib/hecks/quality_control/cli/qa_pr_check/checking.rb +118 -0
- data/lib/hecks/quality_control/cli/qa_pr_check/reporting.rb +54 -0
- data/lib/hecks/quality_control/cli/qa_pr_check.rb +28 -145
- data/lib/hecks/quality_control/cli/qa_seed_angles/seed.rb +80 -0
- data/lib/hecks/quality_control/cli/qa_seed_angles.rb +13 -86
- data/lib/hecks/quality_control/cli/qa_sweep/all_mode/children.rb +80 -0
- data/lib/hecks/quality_control/cli/qa_sweep/all_mode/report.rb +125 -0
- data/lib/hecks/quality_control/cli/qa_sweep/all_mode.rb +63 -193
- data/lib/hecks/quality_control/cli/qa_sweep/checks/boundary.rb +92 -0
- data/lib/hecks/quality_control/cli/qa_sweep/checks/engines.rb +92 -0
- data/lib/hecks/quality_control/cli/qa_sweep/checks/seeds.rb +86 -0
- data/lib/hecks/quality_control/cli/qa_sweep/checks/shrinking.rb +69 -0
- data/lib/hecks/quality_control/cli/qa_sweep/checks.rb +10 -248
- data/lib/hecks/quality_control/cli/qa_sweep/conclusion.rb +60 -0
- data/lib/hecks/quality_control/cli/qa_sweep/depth.rb +61 -0
- data/lib/hecks/quality_control/cli/qa_sweep/dials.rb +26 -13
- data/lib/hecks/quality_control/cli/qa_sweep/finding_report/shrunk.rb +42 -0
- data/lib/hecks/quality_control/cli/qa_sweep/finding_report.rb +40 -41
- data/lib/hecks/quality_control/cli/qa_sweep/parsing/validation.rb +70 -0
- data/lib/hecks/quality_control/cli/qa_sweep/parsing.rb +35 -65
- data/lib/hecks/quality_control/cli/qa_sweep/release_mode.rb +41 -22
- data/lib/hecks/quality_control/cli/qa_sweep/scratch.rb +67 -0
- data/lib/hecks/quality_control/cli/qa_sweep/seat.rb +94 -0
- data/lib/hecks/quality_control/cli/qa_sweep/seed_loop.rb +149 -0
- data/lib/hecks/quality_control/cli/qa_sweep/target_setup.rb +115 -0
- data/lib/hecks/quality_control/cli/qa_sweep.rb +22 -445
- data/lib/hecks/quality_control/cli/qa_tick/output.rb +107 -0
- data/lib/hecks/quality_control/cli/qa_tick/preflight.rb +95 -0
- data/lib/hecks/quality_control/cli/qa_tick.rb +42 -175
- data/lib/hecks/query_ir/formatting.rb +86 -0
- data/lib/hecks/query_ir/rules.rb +132 -0
- data/lib/hecks/query_ir/touchpoints.rb +104 -0
- data/lib/hecks/query_ir.rb +33 -281
- data/lib/hecks/query_ir_mcp/tools.rb +68 -0
- data/lib/hecks/query_ir_mcp.rb +27 -71
- data/lib/hecks/query_specification/common/comparison.rb +25 -5
- data/lib/hecks/query_specification/common/dsl.rb +1 -1
- data/lib/hecks/query_specification/common/null_policy.rb +9 -6
- data/lib/hecks/query_specification/common/options.rb +21 -14
- data/lib/hecks/query_specification/field_path.rb +5 -2
- data/lib/hecks/query_specification/hop_path.rb +15 -18
- data/lib/hecks/release/lane.rb +22 -0
- data/lib/hecks/release/runner/clean_tree.rb +2 -2
- data/lib/hecks/release/runner/commands.rb +1 -1
- data/lib/hecks/release/runner/options.rb +82 -0
- data/lib/hecks/release/runner/preflight.rb +12 -7
- data/lib/hecks/release/runner/publishing.rb +86 -0
- data/lib/hecks/release/runner/tagger.rb +8 -3
- data/lib/hecks/release/runner.rb +40 -156
- data/lib/hecks/rendering.rb +13 -9
- data/lib/hecks/router/door.rb +37 -0
- data/lib/hecks/router/namespace_installer.rb +45 -83
- data/lib/hecks/router/options_proxy.rb +44 -0
- data/lib/hecks/runtime/adapter_lookup.rb +45 -24
- data/lib/hecks/runtime/command_interpreter/argument_gate.rb +16 -8
- data/lib/hecks/runtime/command_interpreter/delegation.rb +116 -0
- data/lib/hecks/runtime/command_interpreter/enforcement.rb +38 -0
- data/lib/hecks/runtime/command_interpreter/hydration.rb +139 -0
- data/lib/hecks/runtime/command_interpreter/list_mutations.rb +98 -0
- data/lib/hecks/runtime/command_interpreter/mutation_applier.rb +67 -114
- data/lib/hecks/runtime/command_interpreter/persisting.rb +96 -0
- data/lib/hecks/runtime/command_interpreter.rb +57 -352
- data/lib/hecks/runtime/command_rules/admissibility.rb +64 -147
- data/lib/hecks/runtime/command_rules/arithmetic.rb +13 -72
- data/lib/hecks/runtime/command_rules/authorization.rb +9 -9
- data/lib/hecks/runtime/command_rules/emission.rb +13 -14
- data/lib/hecks/runtime/command_rules/guard_state.rb +49 -0
- data/lib/hecks/runtime/command_rules/invariants.rb +84 -0
- data/lib/hecks/runtime/command_rules/operands.rb +88 -0
- data/lib/hecks/runtime/command_rules/references.rb +59 -57
- data/lib/hecks/runtime/command_rules/tenant_boundary.rb +69 -0
- data/lib/hecks/runtime/dependency_planning/analyzer.rb +90 -0
- data/lib/hecks/runtime/dependency_planning/expression_reads.rb +73 -0
- data/lib/hecks/runtime/dependency_planning/mutation_analysis.rb +89 -0
- data/lib/hecks/runtime/dependency_planning/rule_analysis.rb +82 -0
- data/lib/hecks/runtime/dependency_planning.rb +3 -250
- data/lib/hecks/runtime/dispatcher/queries.rb +62 -0
- data/lib/hecks/runtime/dispatcher/result.rb +55 -0
- data/lib/hecks/runtime/dispatcher/routing.rb +107 -0
- data/lib/hecks/runtime/dispatcher.rb +64 -209
- data/lib/hecks/runtime/entity_element/location.rb +124 -0
- data/lib/hecks/runtime/entity_element/mutations.rb +150 -0
- data/lib/hecks/runtime/entity_element.rb +5 -177
- data/lib/hecks/runtime/entity_interpreter/enforcement.rb +51 -0
- data/lib/hecks/runtime/entity_interpreter/locating.rb +62 -0
- data/lib/hecks/runtime/entity_interpreter/resolution.rb +42 -0
- data/lib/hecks/runtime/entity_interpreter/saving.rb +49 -0
- data/lib/hecks/runtime/entity_interpreter.rb +45 -164
- data/lib/hecks/runtime/identity.rb +15 -9
- data/lib/hecks/runtime/instance.rb +11 -7
- data/lib/hecks/runtime/interpreting.rb +16 -8
- data/lib/hecks/runtime/invocation.rb +3 -155
- data/lib/hecks/runtime/invocation_builder.rb +132 -0
- data/lib/hecks/runtime/invocation_facts.rb +87 -0
- data/lib/hecks/runtime/loader/boot_steps.rb +96 -0
- data/lib/hecks/runtime/loader/described.rb +27 -0
- data/lib/hecks/runtime/loader.rb +27 -114
- data/lib/hecks/runtime/outbox/consumer_runner.rb +40 -0
- data/lib/hecks/runtime/outbox/fanout.rb +82 -0
- data/lib/hecks/runtime/outbox/relay.rb +149 -0
- data/lib/hecks/runtime/outbox.rb +3 -214
- data/lib/hecks/runtime/policy_interpreter/arguments.rb +67 -0
- data/lib/hecks/runtime/policy_interpreter/fan_out.rb +96 -0
- data/lib/hecks/runtime/policy_interpreter.rb +22 -137
- data/lib/hecks/runtime/port_operation_interpreter.rb +18 -17
- data/lib/hecks/runtime/query_interpreter/arguments.rb +51 -0
- data/lib/hecks/runtime/query_interpreter/entity_rows.rb +82 -0
- data/lib/hecks/runtime/query_interpreter/outside_answer.rb +89 -0
- data/lib/hecks/runtime/query_interpreter.rb +43 -191
- data/lib/hecks/runtime/reaction_invocation/identities.rb +92 -0
- data/lib/hecks/runtime/reaction_invocation/target_resolution.rb +88 -0
- data/lib/hecks/runtime/reaction_invocation.rb +66 -183
- data/lib/hecks/runtime/reaction_outcome.rb +7 -3
- data/lib/hecks/runtime/read_model_interpreter/head_ordering.rb +49 -0
- data/lib/hecks/runtime/read_model_interpreter/reductions.rb +123 -0
- data/lib/hecks/runtime/read_model_interpreter/shaping.rb +100 -0
- data/lib/hecks/runtime/read_model_interpreter.rb +71 -214
- data/lib/hecks/runtime/reference_hop.rb +11 -11
- data/lib/hecks/runtime/refusal_wording.rb +11 -8
- data/lib/hecks/runtime/registry/chapter_verification.rb +84 -0
- data/lib/hecks/runtime/registry/declarations.rb +17 -0
- data/lib/hecks/runtime/registry/durability_warnings.rb +71 -0
- data/lib/hecks/runtime/registry/hecksagon_rules.rb +124 -0
- data/lib/hecks/runtime/registry/merging.rb +49 -0
- data/lib/hecks/runtime/registry/providers.rb +139 -0
- data/lib/hecks/runtime/registry/query_verification.rb +144 -0
- data/lib/hecks/runtime/registry/read_repository.rb +61 -0
- data/lib/hecks/runtime/registry/runtime_state.rb +27 -0
- data/lib/hecks/runtime/registry/saga_persistence.rb +12 -8
- data/lib/hecks/runtime/registry/verification.rb +45 -389
- data/lib/hecks/runtime/registry/world_defaults.rb +3 -3
- data/lib/hecks/runtime/registry.rb +58 -296
- data/lib/hecks/runtime/remote_dispatcher.rb +47 -31
- data/lib/hecks/runtime/saga_interpreter/compensation.rb +90 -0
- data/lib/hecks/runtime/saga_interpreter/correlation.rb +19 -10
- data/lib/hecks/runtime/saga_interpreter/delivery.rb +147 -0
- data/lib/hecks/runtime/saga_interpreter/lifecycle.rb +63 -0
- data/lib/hecks/runtime/saga_interpreter/transitions.rb +112 -0
- data/lib/hecks/runtime/saga_interpreter.rb +41 -320
- data/lib/hecks/runtime/tenant_check.rb +14 -9
- data/lib/hecks/runtime/value/admission.rb +28 -19
- data/lib/hecks/runtime/value/coercion.rb +55 -404
- data/lib/hecks/runtime/value/entity_list_coercion.rb +27 -29
- data/lib/hecks/runtime/value/field_checks.rb +57 -100
- data/lib/hecks/runtime/value/flags.rb +65 -0
- data/lib/hecks/runtime/value/identifiers.rb +64 -0
- data/lib/hecks/runtime/value/references.rb +195 -0
- data/lib/hecks/runtime/value/shape_checks.rb +61 -0
- data/lib/hecks/runtime/value/validation.rb +125 -0
- data/lib/hecks/runtime/value.rb +18 -6
- data/lib/hecks/rust_build/conformance/surface.rb +75 -0
- data/lib/hecks/rust_build/conformance.rb +27 -59
- data/lib/hecks/rust_build/conformance_fuzz.rb +26 -15
- data/lib/hecks/rust_build/coverage.rb +32 -104
- data/lib/hecks/rust_build/coverage_parts/expected.rb +68 -0
- data/lib/hecks/rust_build/coverage_parts/printer.rb +75 -0
- data/lib/hecks/rust_build/host.rb +23 -13
- data/lib/hecks/rust_build/kernel_input.rb +19 -12
- data/lib/hecks/rust_build/native_build.rb +19 -15
- data/lib/hecks/rust_build/project_rust/domain_loader.rb +75 -0
- data/lib/hecks/rust_build/project_rust/root_mod/notes.rb +66 -0
- data/lib/hecks/rust_build/project_rust/root_mod.rb +22 -55
- data/lib/hecks/rust_build/project_rust/target_ir.rb +74 -0
- data/lib/hecks/rust_build/project_rust.rb +21 -89
- data/lib/hecks/rust_build/wasm.rb +11 -4
- data/lib/hecks/rust_build/wasm_browser.rb +7 -7
- data/lib/hecks/rust_build/write_if_changed.rb +3 -6
- data/lib/hecks/rust_build.rb +7 -3
- data/lib/hecks/site/bluebook/site.bluebook +7 -1
- data/lib/hecks/storehouse/audit.rb +106 -0
- data/lib/hecks/storehouse/callers.rb +73 -0
- data/lib/hecks/storehouse/dispatching.rb +149 -0
- data/lib/hecks/storehouse/introspection.rb +145 -0
- data/lib/hecks/storehouse/querying.rb +78 -0
- data/lib/hecks/storehouse.rb +43 -451
- data/lib/hecks/tickets/bluebook/tickets.bluebook +29 -0
- data/lib/hecks/tools/argument_gate_matrix/dispatching.rb +69 -0
- data/lib/hecks/tools/argument_gate_matrix/rows.rb +121 -0
- data/lib/hecks/tools/argument_gate_matrix/violations.rb +108 -0
- data/lib/hecks/tools/argument_gate_matrix.rb +43 -212
- data/lib/hecks/tools/ci_gate_decision.rb +21 -14
- data/lib/hecks/tools/ci_gates.rb +40 -26
- data/lib/hecks/tools/comment_style/baseline.rb +41 -0
- data/lib/hecks/tools/comment_style/caps_words.rb +104 -0
- data/lib/hecks/tools/comment_style/cli.rb +121 -0
- data/lib/hecks/tools/comment_style/dictionary.rb +60 -0
- data/lib/hecks/tools/comment_style/fixing.rb +119 -0
- data/lib/hecks/tools/comment_style/long_blocks.rb +51 -0
- data/lib/hecks/tools/comment_style/masking.rb +94 -0
- data/lib/hecks/tools/comment_style/patterns.rb +61 -0
- data/lib/hecks/tools/comment_style/run.rb +161 -0
- data/lib/hecks/tools/comment_style/signature.rb +59 -0
- data/lib/hecks/tools/comment_style/source_file.rb +105 -0
- data/lib/hecks/tools/comment_style/structure_checks.rb +113 -0
- data/lib/hecks/tools/comment_style/text_checks.rb +67 -0
- data/lib/hecks/tools/comment_style/vocabulary.rb +55 -0
- data/lib/hecks/tools/comment_style/walker.rb +136 -0
- data/lib/hecks/tools/comment_style.rb +17 -1000
- data/lib/hecks/tools/corpus_report.rb +26 -16
- data/lib/hecks/tools/deploy_recipe/targets.rb +61 -0
- data/lib/hecks/tools/deploy_recipe/worlds.rb +114 -0
- data/lib/hecks/tools/deploy_recipe.rb +60 -174
- data/lib/hecks/tools/deploy_recipe_lint/checks.rb +78 -0
- data/lib/hecks/tools/deploy_recipe_lint/fixtures.rb +88 -0
- data/lib/hecks/tools/deploy_recipe_lint/makefile.rb +84 -0
- data/lib/hecks/tools/deploy_recipe_lint.rb +29 -192
- data/lib/hecks/tools/drop_implicit_append_fields.rb +20 -12
- data/lib/hecks/tools/era_projection_backfill.rb +50 -33
- data/lib/hecks/tools/era_reattest/reporting.rb +55 -0
- data/lib/hecks/tools/era_reattest.rb +32 -43
- data/lib/hecks/tools/evolve_run/arguments.rb +49 -0
- data/lib/hecks/tools/evolve_run/words.rb +60 -0
- data/lib/hecks/tools/evolve_run.rb +43 -90
- data/lib/hecks/tools/fuzz_sweep/findings.rb +106 -0
- data/lib/hecks/tools/fuzz_sweep/options.rb +69 -0
- data/lib/hecks/tools/fuzz_sweep/pool.rb +74 -0
- data/lib/hecks/tools/fuzz_sweep/reporting.rb +88 -0
- data/lib/hecks/tools/fuzz_sweep.rb +75 -273
- data/lib/hecks/tools/gate.rb +31 -16
- data/lib/hecks/tools/heki_compaction.rb +63 -42
- data/lib/hecks/tools/hoist_local_givens/rewriting.rb +119 -0
- data/lib/hecks/tools/hoist_local_givens.rb +89 -157
- data/lib/hecks/tools/journal_compaction.rb +40 -31
- data/lib/hecks/tools/lanes/files.rb +82 -0
- data/lib/hecks/tools/lanes/live.rb +41 -0
- data/lib/hecks/tools/lanes/rows.rb +45 -0
- data/lib/hecks/tools/lanes/ruleset.rb +44 -0
- data/lib/hecks/tools/lanes/watch_workflow.rb +82 -0
- data/lib/hecks/tools/lanes/workflow.rb +79 -0
- data/lib/hecks/tools/lanes.rb +71 -0
- data/lib/hecks/tools/oidc_manifests.rb +10 -9
- data/lib/hecks/tools/query_ir_run.rb +7 -3
- data/lib/hecks/tools/regeneration_run.rb +40 -26
- data/lib/hecks/tools/rust_comment_style/caps_words.rb +98 -0
- data/lib/hecks/tools/rust_comment_style/fixing.rb +102 -0
- data/lib/hecks/tools/rust_comment_style/masking.rb +85 -0
- data/lib/hecks/tools/rust_comment_style/run.rb +94 -0
- data/lib/hecks/tools/rust_comment_style/source_file.rb +71 -0
- data/lib/hecks/tools/rust_comment_style/structure.rb +79 -0
- data/lib/hecks/tools/rust_comment_style/text_checks.rb +63 -0
- data/lib/hecks/tools/rust_comment_style/tokenizer.rb +102 -0
- data/lib/hecks/tools/rust_comment_style.rb +38 -535
- data/lib/hecks/tools/sequence_script.rb +20 -14
- data/lib/hecks/tools/site_routes/cli.rb +70 -0
- data/lib/hecks/tools/site_routes/root_files.rb +59 -0
- data/lib/hecks/tools/site_routes/templates.rb +77 -0
- data/lib/hecks/tools/site_routes.rb +102 -108
- data/lib/hecks/tools/tail_merge.rb +45 -37
- data/lib/hecks/tools/tenant_provisioning.rb +45 -31
- data/lib/hecks/tools/tools_doc.rb +42 -19
- data/lib/hecks/tools/translation_audit/domain_loading.rb +71 -0
- data/lib/hecks/tools/translation_audit/edges.rb +71 -0
- data/lib/hecks/tools/translation_audit/verdicts.rb +107 -0
- data/lib/hecks/tools/translation_audit.rb +30 -161
- data/lib/hecks/tools/translation_scaffold/reporting.rb +40 -0
- data/lib/hecks/tools/translation_scaffold.rb +77 -60
- data/lib/hecks/tools.rb +1 -0
- data/lib/hecks/vendoring.rb +37 -11
- data/lib/hecks/version.rb +1 -1
- data/lib/hecks/vocabulary.rb +16 -1
- data/lib/rubocop/cop/hecks/fallback_hash_lookup.rb +7 -9
- data/lib/rubocop/cop/hecks/thread_shared_ivar_mutation.rb +8 -6
- data/rust/.cargo/mutants.toml +8 -0
- data/rust/host/Cargo.toml +5 -0
- data/rust/host/HECKS_RELEASE +1 -1
- data/rust/host/src/auth.rs +32 -0
- data/rust/host/src/web.rs +2 -3
- data/rust/src/kernel/dispatch.rs +4 -0
- data/rust/src/kernel/dispatch_guard_tests.rs +506 -0
- data/rust/src/kernel/orchestrate.rs +4 -0
- data/rust/src/kernel/orchestrate_guard_tests.rs +708 -0
- metadata +607 -3
- /data/lib/hecks/bluebook/behaviour/{hexagon.rb → hecksagon.rb} +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
@echo "Looking up $(STACK)'s VPC/security group..."
|
|
2
|
+
# stack_outputs/bastion_parameters (hecks deploy project) are the ONE
|
|
3
|
+
# place these OutputKey strings and parameter names live — this eval
|
|
4
|
+
# chain and the --parameter-overrides line just below are both
|
|
5
|
+
# generated from the SAME table template.yaml's Outputs and
|
|
6
|
+
# bastion.yaml's Parameters already read from.
|
|
7
|
+
@@eval_lines@@
|
|
8
|
+
@echo "Deploying the temporary bastion stack $(BASTION_STACK)..."
|
|
9
|
+
aws cloudformation deploy --template-file bastion.yaml --stack-name $(BASTION_STACK) \
|
|
10
|
+
--parameter-overrides @@parameter_overrides@@ \
|
|
11
|
+
--capabilities CAPABILITY_IAM
|
|
12
|
+
# ONE continuous shell invocation from here on (every line ends in
|
|
13
|
+
# \, joining it to the next) — INSTANCE_ID is a SHELL variable, not
|
|
14
|
+
# a Make one: a Make-level $$(eval $$(shell ...)) expands at parse
|
|
15
|
+
# time, BEFORE the `aws cloudformation deploy` line above ever runs,
|
|
16
|
+
# which would make INSTANCE_ID permanently empty. It can only be
|
|
17
|
+
# computed here, after the bastion stack genuinely exists.
|
|
18
|
+
#
|
|
19
|
+
# A COMMENT LINE MUST NEVER SIT BETWEEN TWO \-CONTINUED RECIPE
|
|
20
|
+
# LINES — confirmed live, the hard way: a `#`-prefixed line inserted
|
|
21
|
+
# between `DB_PASS=...; \` and the line that used it silently
|
|
22
|
+
# corrupted Make's own assembly of this whole block into one shell
|
|
23
|
+
# script, and `DB_PASS` came out empty on the far side despite
|
|
24
|
+
# printing correctly one line earlier. Every explanatory comment for
|
|
25
|
+
# this whole chain belongs HERE, before it starts, same as this one —
|
|
26
|
+
# never spliced into the middle of it.
|
|
27
|
+
#
|
|
28
|
+
# BASTION TEARDOWN IS PART OF THIS SAME CHAIN, ALL THE WAY THROUGH —
|
|
29
|
+
# a prior version of this recipe ended at `exit $$BOOT_STATUS` with
|
|
30
|
+
# no trailing `\`, which made Make treat the delete-stack lines
|
|
31
|
+
# after it as a SEPARATE recipe line, reached only on a zero exit.
|
|
32
|
+
# A failed boot (bad tunnel, bad `ruby -e` invocation, anything) left
|
|
33
|
+
# the bastion stack standing forever — including a live 5432 ingress
|
|
34
|
+
# rule punched into the PRODUCTION RDS security group. Teardown now
|
|
35
|
+
# runs unconditionally, with BOOT_STATUS captured up front and
|
|
36
|
+
# returned last, so `make mint-era`'s own exit code still reflects
|
|
37
|
+
# whether era 1 actually got minted.
|
|
38
|
+
#
|
|
39
|
+
# `LineageManager.check!` directly below, NOT `Hecks.boot` — also
|
|
40
|
+
# confirmed live (the very first real invoke: "relation
|
|
41
|
+
# \"hecks_eras\" does not exist", despite this step itself
|
|
42
|
+
# reporting success): `Hecks.boot` always dispatches persistence
|
|
43
|
+
# through whatever the domain's OWN .world file declares
|
|
44
|
+
# (`persisted_by("Heki")` for a domain that hasn't opted into
|
|
45
|
+
# Postgres for local dev), by EXPLICIT design — loader.rb's own
|
|
46
|
+
# comment: "persisted_by(\"PostgresEra\") is never inferred from
|
|
47
|
+
# anything else." `EraCheck.check!` (what `Hecks.boot` runs) is
|
|
48
|
+
# itself adapter-capability-gated on that same declaration and simply
|
|
49
|
+
# no-ops for a non-lineage-capable adapter — it never touches
|
|
50
|
+
# hecks_eras at all. The fix reuses the SAME loading pipeline
|
|
51
|
+
# `Loader.boot` itself does (`Ports::Loading.bootstrap`/
|
|
52
|
+
# `load_library`/`load_project`/`load_domain`) to build a real,
|
|
53
|
+
# fully-loaded registry (bluebook + any attaches attachments),
|
|
54
|
+
# then calls straight into PostgresEra's own `LineageManager.check!`
|
|
55
|
+
# with THIS deploy's actual `DATABASE_URL` — bypassing the world
|
|
56
|
+
# file's own adapter choice entirely, the same targeted pattern
|
|
57
|
+
# spec/adapters/driven/postgres_era/lineage_spec.rb's own `check!` helper
|
|
58
|
+
# already uses.
|
|
59
|
+
#
|
|
60
|
+
# THE WHOLE TUNNEL IS RESTARTED PER ATTEMPT, not just the boot
|
|
61
|
+
# check retried through one long-lived tunnel — confirmed live,
|
|
62
|
+
# the hard way: an SSM port-forwarding session can start and then
|
|
63
|
+
# exit again within the first few seconds (visible in its own log
|
|
64
|
+
# as a session ID that both starts AND exits before the retries
|
|
65
|
+
# even finish), not merely "slow to become ready". Retrying a
|
|
66
|
+
# Postgres connection five times against a tunnel process that has
|
|
67
|
+
# already died is retrying against a corpse — it fails identically
|
|
68
|
+
# every time, for a different reason than the one the retry was
|
|
69
|
+
# built for. Each attempt below kills whatever tunnel the LAST
|
|
70
|
+
# attempt opened (a no-op the first time) and opens a fresh one,
|
|
71
|
+
# so a dead session gets a real replacement, not just more patience.
|
|
72
|
+
#
|
|
73
|
+
# DB_PASS_URLENC, DERIVED RIGHT AFTER DB_PASS BELOW, IS WHAT ACTUALLY
|
|
74
|
+
# GOES INTO THE `postgres://` URL FURTHER DOWN — not DB_PASS itself.
|
|
75
|
+
# RDS/Secrets-Manager-generated passwords are not guaranteed free of
|
|
76
|
+
# `%`, and libpq's own connection-URI parser treats a bare `%` as an
|
|
77
|
+
# invalid token (percent-encoding is the one escape libpq's URI form
|
|
78
|
+
# actually documents and decodes; a raw `%` is not) -- roughly 29% of
|
|
79
|
+
# 32-char generated passwords contain at least one `%`, so this was
|
|
80
|
+
# silently unreachable until it wasn't. `ERB::Util.url_encode`
|
|
81
|
+
# percent-encodes everything outside RFC 3986's unreserved set,
|
|
82
|
+
# exactly what a URI password component needs -- a strict superset
|
|
83
|
+
# of the ExcludeCharacters the Aurora path below already excludes
|
|
84
|
+
# (a no-op there), and the actual fix for the plain-RDS
|
|
85
|
+
# ManageMasterUserPassword path, whose generated character set this
|
|
86
|
+
# template has no control over at all. This comment sits HERE,
|
|
87
|
+
# before the chain starts, on purpose -- see the note further below
|
|
88
|
+
# on why a comment line can never be spliced between two
|
|
89
|
+
# ``-continued recipe lines.
|
|
90
|
+
@INSTANCE_ID=$$(aws cloudformation describe-stacks --stack-name $(BASTION_STACK) --query "Stacks[0].Outputs[?OutputKey=='InstanceId'].OutputValue" --output text); \
|
|
91
|
+
echo "Waiting for $$INSTANCE_ID to register with SSM..."; \
|
|
92
|
+
for i in $$(seq 1 30); do \
|
|
93
|
+
STATUS=$$(aws ssm describe-instance-information --filters "Key=InstanceIds,Values=$$INSTANCE_ID" --query "InstanceInformationList[0].PingStatus" --output text 2>/dev/null); \
|
|
94
|
+
if [ "$$STATUS" = "Online" ]; then break; fi; \
|
|
95
|
+
sleep 5; \
|
|
96
|
+
done; \
|
|
97
|
+
DB_PASS=$$(aws secretsmanager get-secret-value --secret-id $(DB_SECRET_ARN) --query SecretString --output text | ruby -rjson -e 'print JSON.parse(STDIN.read)["password"]'); \
|
|
98
|
+
DB_PASS_URLENC=$$(ruby -rerb -e 'print ERB::Util.url_encode(ARGV[0])' "$$DB_PASS"); \
|
|
99
|
+
BOOT_STATUS=1; \
|
|
100
|
+
for attempt in 1 2 3 4 5; do \
|
|
101
|
+
kill $$TUNNEL_PID 2>/dev/null; \
|
|
102
|
+
echo "Opening an SSM tunnel to $(DB_HOST):5432 and minting era 1 (attempt $$attempt/5)..."; \
|
|
103
|
+
aws ssm start-session --target $$INSTANCE_ID \
|
|
104
|
+
--document-name AWS-StartPortForwardingSessionToRemoteHost \
|
|
105
|
+
--parameters "{\"host\":[\"$(DB_HOST)\"],\"portNumber\":[\"5432\"],\"localPortNumber\":[\"15432\"]}" \
|
|
106
|
+
>/tmp/$(BASTION_STACK)-tunnel-$$attempt.log 2>&1 & \
|
|
107
|
+
TUNNEL_PID=$$!; \
|
|
108
|
+
for i in $$(seq 1 15); do \
|
|
109
|
+
nc -z localhost 15432 2>/dev/null && break; \
|
|
110
|
+
sleep 1; \
|
|
111
|
+
done; \
|
|
112
|
+
cd $(ROOT) && DATABASE_URL="postgres://postgres:$$DB_PASS_URLENC@localhost:15432/@@db_name@@" ruby -Ilib -e 'require "hecks"; require "hecks/ports/persistence/plugins/era"; loading = Hecks::Ports::Loading.bootstrap; directory = loading.bluebook_directory(ARGV[0]); root = loading.shared_root(nil, directory); registry = Hecks::Runtime::Registry.new(root: File.dirname(directory)); Hecks.with_registry(registry) { loading.load_library; loading.load_project(root); loading.load_domain(directory) }; bluebook = registry.bluebooks[@@declared_domain_literal@@] or abort "no @@declared_domain_name@@ bluebook loaded"; current_text = Hecks::Runtime::EraCheck.source_text_for(bluebook, directory); Hecks::Adapters::PostgresEra::LineageManager.check!(registry: registry, bluebook: bluebook, current_text: current_text, settings: { database: ENV["DATABASE_URL"]@@schema_setting@@ }); db = Hecks::Adapters::PostgresEra.connect_for(bluebook.name, { database: ENV["DATABASE_URL"]@@schema_setting@@ }); lineage = Hecks::Adapters::PostgresEra::Lineage.new(db, bluebook.name); (registry.bluebooks.values - [bluebook]).each { |other| other.aggregates.each { |aggregate| lineage.ensure_first_head!(aggregate.storage_name) } }; db.close; puts "booted OK — era resolution ran"' $(DOMAIN) && { BOOT_STATUS=0; break; }; \
|
|
113
|
+
BOOT_STATUS=$$?; \
|
|
114
|
+
echo "boot check attempt $$attempt/5 failed (exit $$BOOT_STATUS) -- restarting the tunnel and retrying in 3s..."; \
|
|
115
|
+
sleep 3; \
|
|
116
|
+
done; \
|
|
117
|
+
kill $$TUNNEL_PID 2>/dev/null; \
|
|
118
|
+
echo "Tearing down the temporary bastion stack..."; \
|
|
119
|
+
aws cloudformation delete-stack --stack-name $(BASTION_STACK); \
|
|
120
|
+
aws cloudformation wait stack-delete-complete --stack-name $(BASTION_STACK); \
|
|
121
|
+
echo "$(BASTION_STACK) deleted. Era 1 should now be held if BOOT_STATUS was 0 — verify with hecks console or a Postgres query against hecks_eras."; \
|
|
122
|
+
exit $$BOOT_STATUS
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# NOT AUTOMATED YET for a Shared-mode domain — it has no RDS/VPC
|
|
2
|
+
# of its own to stand a temporary bastion next to (bastion.yaml
|
|
3
|
+
# itself isn't even generated here — hecks deploy project's own
|
|
4
|
+
# comment on why). Minting era 1 for @@infra_name@@'s own schema
|
|
5
|
+
# needs a tunnel to @@owner_domain_name@@'s ALREADY-EXISTING RDS
|
|
6
|
+
# instance instead -- reuse @@owner_domain_name@@'s own deploy
|
|
7
|
+
# directory's `make mint-era` machinery (or an already-open
|
|
8
|
+
# tunnel to it) to run this domain's own boot against
|
|
9
|
+
# `postgres://...@<tunnel-host>:<port>/@@owner_db_name@@` with
|
|
10
|
+
# `schema: @@infra_name_literal@@` in LineageManager.check!'s own
|
|
11
|
+
# settings -- the exact same call this target runs automatically
|
|
12
|
+
# for a domain with its own dedicated instance.
|
|
13
|
+
#
|
|
14
|
+
# IF THIS DOMAIN VENDORS/ATTACHES ANOTHER BLUEBOOK (attaches,
|
|
15
|
+
# attaches ... from: :vendor), `check!` alone leaves THAT chapter's own
|
|
16
|
+
# aggregates with no snapshot table at all -- it only provisions the
|
|
17
|
+
# ONE bluebook it's called with (era_resolver.rb's own `bluebook.
|
|
18
|
+
# aggregates.each`), never the whole registry. Found live minting
|
|
19
|
+
# a client site's own era: `Payments::Payment.Initiate` refused with
|
|
20
|
+
# "relation \"payment_head_snapshot_1\" does not exist" the first
|
|
21
|
+
# time this domain's own checkout route ran for real. The automated
|
|
22
|
+
# (non-Shared) recipe below now does this correctly for every OTHER
|
|
23
|
+
# loaded bluebook, using ONE `Lineage` keyed by THIS domain's own
|
|
24
|
+
# name (never each chapter's own -- a vendored chapter's aggregates
|
|
25
|
+
# share THIS domain's single `hecks_journal_@@infra_name@@` and
|
|
26
|
+
# snapshot tables, they do not get a separate journal of their own).
|
|
27
|
+
# Reproduce the same shape manually here: after `LineageManager.
|
|
28
|
+
# check!` returns, `db = PostgresEra.connect_for(bluebook.name,
|
|
29
|
+
# settings)`, `lineage = Lineage.new(db, bluebook.name)`, then for
|
|
30
|
+
# every OTHER loaded bluebook's own aggregates, `lineage.
|
|
31
|
+
# ensure_first_head!(aggregate.storage_name)`.
|
|
32
|
+
#
|
|
33
|
+
# EXIT 0, NOT 1 -- `deploy:`'s own last line (below) always chains
|
|
34
|
+
# `$(MAKE) mint-era` unconditionally, even for a Shared-mode domain,
|
|
35
|
+
# so a nonzero exit here used to mean a fully successful `sam
|
|
36
|
+
# deploy` still left `make deploy` exiting nonzero -- confirmed
|
|
37
|
+
# live: CI and any scripted caller read every Shared-mode deploy as
|
|
38
|
+
# failed, which trains operators to ignore a red `make deploy` on
|
|
39
|
+
# exactly the domains where a real failure most needs to stand out.
|
|
40
|
+
# This step never fails at its own job (it has no automated job to
|
|
41
|
+
# fail at -- it only reports that a manual step remains), so it
|
|
42
|
+
# reports success and leaves the manual-step reminder in the echo
|
|
43
|
+
# text above, not in the exit code. A human running `make mint-era`
|
|
44
|
+
# directly still SEES the same message; they just don't get a
|
|
45
|
+
# misleading "command failed" on top of it either.
|
|
46
|
+
@echo "mint-era isn't automated yet for a Shared-mode domain (database \"Shared\") -- see this target's own comment in the generated Makefile for the manual path through @@owner_domain_name@@'s own tunnel. This is NOT a failure -- exiting 0 so a genuinely successful \"make deploy\" still reports success; era-minting for this domain remains a separate manual step."; \
|
|
47
|
+
exit 0
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#
|
|
2
|
+
# @@web_logical_id@@ is the ONE exception -- real Google OAuth token
|
|
3
|
+
# exchange (hecks's own GoogleAuthentication adapter posting to
|
|
4
|
+
# https://oauth2.googleapis.com/token) is a genuine third-party HTTPS
|
|
5
|
+
# call with no AWS PrivateLink/VPC Endpoint option (unlike
|
|
6
|
+
# lambda:InvokeFunction, above), and @@web_logical_id@@ is ALSO
|
|
7
|
+
# VPC-attached (Member's own permanent Postgres binding needs the
|
|
8
|
+
# private RDS instance directly). A real, live 15-second Lambda
|
|
9
|
+
# timeout caught this -- the token-exchange POST had nowhere to
|
|
10
|
+
# route to and just hung. @@db_id@@NatGateway below is the real,
|
|
11
|
+
# ongoing-cost fix (one NAT Gateway, one public subnet) -- opt-in,
|
|
12
|
+
# the SAME google_oauth_present signal that wires
|
|
13
|
+
# GOOGLE_CLIENT_ID/SECRET, since nothing else in this stack needs
|
|
14
|
+
# outbound internet at all.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# deploy's own last step below looks up @@web_logical_id@@'s
|
|
2
|
+
# CURRENTLY deployed Function URL live (not tracked anywhere
|
|
3
|
+
# generated) and passes it as WebRedirectBaseUrl -- see that
|
|
4
|
+
# Parameter's own comment, above, for why GOOGLE_REDIRECT_URI can't
|
|
5
|
+
# just be a CloudFormation intrinsic. Empty on a genuine first
|
|
6
|
+
# deploy (before the Url exists at all); every deploy after that
|
|
7
|
+
# finds the real, STABLE hostname (confirmed unchanged across every
|
|
8
|
+
# redeploy this session) and self-heals GOOGLE_REDIRECT_URI to match.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Lambda Function URLs get a random, un-derivable hostname at
|
|
2
|
+
# creation -- @@web_logical_id@@'s own GOOGLE_REDIRECT_URI can't
|
|
3
|
+
# reference `!GetAtt @@web_logical_id@@Url.FunctionUrl` from inside
|
|
4
|
+
# @@web_logical_id@@'s OWN Environment (that's a real circular
|
|
5
|
+
# dependency CloudFormation rejects: the value doesn't exist until
|
|
6
|
+
# the function+URL do). Resolved OUTSIDE the stack instead --
|
|
7
|
+
# `make deploy`'s own recipe looks up the CURRENTLY deployed
|
|
8
|
+
# Function URL (empty on a true first deploy, before the URL
|
|
9
|
+
# exists at all) and passes it as `--parameter-overrides`; every
|
|
10
|
+
# deploy after the first self-heals this correctly.
|
|
11
|
+
WebRedirectBaseUrl:
|
|
12
|
+
Type: String
|
|
13
|
+
Default: ""
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# THE STOREHOUSE — @@owner_domain_name@@'s own live stack Outputs,
|
|
2
|
+
# looked up at deploy time (Makefile's own `deploy:`/`mint-era`
|
|
3
|
+
# targets, below) via the SAME `aws cloudformation describe-stacks`
|
|
4
|
+
# pattern `mint-era` already used for a bastion, one stack over
|
|
5
|
+
# instead of one sibling stack over. Never a CloudFormation
|
|
6
|
+
# Export/ImportValue -- this codebase uses none anywhere (hecks
|
|
7
|
+
# deploy project's own header on why: a live shell lookup keeps
|
|
8
|
+
# this stack independently deployable/deletable, never coupled to
|
|
9
|
+
# @@owner_domain_name@@'s own stack through CloudFormation itself).
|
|
10
|
+
OwningVpcId:
|
|
11
|
+
Type: AWS::EC2::VPC::Id
|
|
12
|
+
OwningSubnetAId:
|
|
13
|
+
Type: AWS::EC2::Subnet::Id
|
|
14
|
+
OwningSubnetBId:
|
|
15
|
+
Type: AWS::EC2::Subnet::Id
|
|
16
|
+
# @@owner_domain_name@@'s own Lambda security group, NOT its
|
|
17
|
+
# DB-facing one -- reused whole, not copied, the same shape
|
|
18
|
+
# this codebase already trusts elsewhere (a WebFunction sharing
|
|
19
|
+
# its own dispatch Lambda's security group rather than minting
|
|
20
|
+
# a second one), one stack over instead of one resource over.
|
|
21
|
+
# @@owner_domain_name@@'s own DB security group already permits
|
|
22
|
+
# ingress FROM this group (every member of it, regardless of
|
|
23
|
+
# which stack minted the member -- security group references
|
|
24
|
+
# match on GROUP MEMBERSHIP, not resource identity), so joining
|
|
25
|
+
# it is what actually grants this Lambda access, not a new
|
|
26
|
+
# ingress rule @@owner_domain_name@@'s own stack would otherwise
|
|
27
|
+
# need to add.
|
|
28
|
+
OwningSecurityGroupId:
|
|
29
|
+
Type: AWS::EC2::SecurityGroup::Id
|
|
30
|
+
OwningDatabaseEndpoint:
|
|
31
|
+
Type: String
|
|
32
|
+
OwningDatabaseSecretArn:
|
|
33
|
+
Type: String
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# @@web_logical_id@@'s own `pg` gem needs a native extension SAM's
|
|
2
|
+
# default Ruby builder can't produce correctly: the precompiled
|
|
3
|
+
# aarch64-linux binary needs GLIBC 2.29+, but Lambda's ruby3.2
|
|
4
|
+
# MANAGED runtime is Amazon Linux 2 (glibc 2.26) — a real, live
|
|
5
|
+
# "Init<NameError>: uninitialized constant PG::Error" caught this
|
|
6
|
+
# (rescuing PG::Error itself failed to resolve, because pg's own
|
|
7
|
+
# `require` died before ever reaching the file that defines it).
|
|
8
|
+
# Built once, from source, in the SAME container `sam build
|
|
9
|
+
# --use-container` itself uses (its glibc, not the host's, is what
|
|
10
|
+
# has to match the deployed runtime) — then cached under
|
|
11
|
+
# PG_NATIVE_DIR so every later `make deploy` skips straight to the
|
|
12
|
+
# fast path. Delete that directory to force a clean rebuild.
|
|
13
|
+
#
|
|
14
|
+
# OpenSSL is built `no-shared` and linked STATICALLY into libpq, so
|
|
15
|
+
# the libpq.so this produces carries no runtime dependency on
|
|
16
|
+
# whatever OpenSSL (if any) happens to already be on the Lambda
|
|
17
|
+
# execution image — sidesteps the AL2 package conflict between
|
|
18
|
+
# `openssl-libs` and the build image's own pre-installed
|
|
19
|
+
# `openssl-snapsafe-libs` entirely, rather than fighting it.
|
|
20
|
+
PG_NATIVE_DIR := @@root@@/tmp/pg-native-arm64-ruby3.2
|
|
21
|
+
|
|
22
|
+
$(PG_NATIVE_DIR)/pg_ext.so:
|
|
23
|
+
@mkdir -p $(PG_NATIVE_DIR)
|
|
24
|
+
@echo "Building @@web_logical_id@@'s pg native extension from source (cached under $(PG_NATIVE_DIR) after this — a few minutes, one time only)..."
|
|
25
|
+
docker run --rm --platform linux/arm64 -v $(PG_NATIVE_DIR):/out \
|
|
26
|
+
--entrypoint /bin/bash public.ecr.aws/sam/build-ruby3.2:latest-arm64 -c ' \
|
|
27
|
+
set -e; \
|
|
28
|
+
yum install -y perl-IPC-Cmd >/dev/null; \
|
|
29
|
+
cd /tmp; \
|
|
30
|
+
curl -sL https://www.openssl.org/source/openssl-3.0.15.tar.gz | tar xz; \
|
|
31
|
+
cd openssl-3.0.15; \
|
|
32
|
+
./Configure linux-aarch64 no-shared no-tests --prefix=/tmp/openssl-install >/dev/null; \
|
|
33
|
+
make -j$$(nproc) >/dev/null; \
|
|
34
|
+
make install_sw >/dev/null; \
|
|
35
|
+
cd /tmp; \
|
|
36
|
+
curl -sL https://ftp.postgresql.org/pub/source/v16.4/postgresql-16.4.tar.gz | tar xz; \
|
|
37
|
+
cd postgresql-16.4; \
|
|
38
|
+
CPPFLAGS="-I/tmp/openssl-install/include" LDFLAGS="-L/tmp/openssl-install/lib" \
|
|
39
|
+
./configure --without-readline --without-zlib --without-icu --with-ssl=openssl --prefix=/tmp/pg-install >/dev/null; \
|
|
40
|
+
make -C src/include install >/dev/null; \
|
|
41
|
+
make -C src/interfaces/libpq -j$$(nproc) install >/dev/null; \
|
|
42
|
+
cd /tmp; \
|
|
43
|
+
gem fetch pg -v @@pg_version@@ --platform ruby >/dev/null; \
|
|
44
|
+
gem unpack pg-@@pg_version@@.gem --target=/tmp/gemsrc >/dev/null; \
|
|
45
|
+
cd /tmp/gemsrc/pg-@@pg_version@@/ext; \
|
|
46
|
+
ruby -I.. -I../lib extconf.rb --with-pg-include=/tmp/pg-install/include --with-pg-lib=/tmp/pg-install/lib >/dev/null; \
|
|
47
|
+
make >/dev/null; \
|
|
48
|
+
cp pg_ext.so /out/pg_ext.so; \
|
|
49
|
+
cp /tmp/pg-install/lib/libpq.so.5.16 /out/libpq.so.5.16; \
|
|
50
|
+
'
|
|
51
|
+
|
|
52
|
+
# `find`, not a hardcoded gem-version path — survives @@domain@@'s
|
|
53
|
+
# own pg version bumping in its Gemfile.lock without this Makefile
|
|
54
|
+
# needing regeneration to match. libpq.so.5.16 lands beside the
|
|
55
|
+
# rest of @@web_logical_id@@'s code at /var/task/lib — the ruby3.2
|
|
56
|
+
# base image's OWN baked-in LD_LIBRARY_PATH default already searches
|
|
57
|
+
# that exact path, so no rpath patching AND no explicit
|
|
58
|
+
# LD_LIBRARY_PATH override belongs in template.yaml (setting one
|
|
59
|
+
# there REPLACES the image's full default list instead of extending
|
|
60
|
+
# it — a real, live "libcrypt.so.1: cannot open shared object file"
|
|
61
|
+
# caught this — @@web_logical_id@@'s own Environment no longer sets
|
|
62
|
+
# it at all, on purpose).
|
|
63
|
+
.PHONY: patch-pg-native
|
|
64
|
+
patch-pg-native: $(PG_NATIVE_DIR)/pg_ext.so
|
|
65
|
+
@PG_EXT=$$(find .aws-sam/build/@@web_logical_id@@/vendor/bundle -path "*/pg-*/lib/3.2/pg_ext.so" | head -1); \
|
|
66
|
+
test -n "$$PG_EXT" || { echo "patch-pg-native: no pg_ext.so found under .aws-sam/build/@@web_logical_id@@ — run sam build --use-container @@web_logical_id@@ first"; exit 1; }; \
|
|
67
|
+
cp $(PG_NATIVE_DIR)/pg_ext.so "$$PG_EXT"
|
|
68
|
+
@mkdir -p .aws-sam/build/@@web_logical_id@@/lib
|
|
69
|
+
cp $(PG_NATIVE_DIR)/libpq.so.5.16 .aws-sam/build/@@web_logical_id@@/lib/libpq.so.5.16
|
|
70
|
+
ln -sf libpq.so.5.16 .aws-sam/build/@@web_logical_id@@/lib/libpq.so.5
|
|
71
|
+
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
PiiLambdaInvokePermission:
|
|
2
|
+
Type: AWS::Lambda::Permission
|
|
3
|
+
Properties:
|
|
4
|
+
Action: lambda:InvokeFunctionUrl
|
|
5
|
+
FunctionName: !Ref @@fronted_logical_id@@
|
|
6
|
+
Principal: cloudfront.amazonaws.com
|
|
7
|
+
SourceArn: !Sub "arn:aws:cloudfront::${AWS::AccountId}:distribution/${PiiDistribution}"
|
|
8
|
+
FunctionUrlAuthType: @@invoke_auth_type@@
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
PiiAccessLogsBucket:
|
|
2
|
+
Type: AWS::S3::Bucket
|
|
3
|
+
Properties:
|
|
4
|
+
# `BucketOwnerPreferred`, not the newer `BucketOwnerEnforced`
|
|
5
|
+
# default — CloudFront's own classic access-log delivery
|
|
6
|
+
# (`Logging:`, on PiiDistribution below) still authorizes itself
|
|
7
|
+
# via a canned ACL (`AccessControlTranslation` between accounts is
|
|
8
|
+
# a distinct, newer mechanism this bucket has no other account to
|
|
9
|
+
# need), which an ACLs-disabled bucket refuses outright.
|
|
10
|
+
OwnershipControls:
|
|
11
|
+
Rules:
|
|
12
|
+
- ObjectOwnership: BucketOwnerPreferred
|
|
13
|
+
AccessControl: LogDeliveryWrite
|
|
14
|
+
LifecycleConfiguration:
|
|
15
|
+
Rules:
|
|
16
|
+
- Id: ExpirePiiAccessLogs
|
|
17
|
+
Status: Enabled
|
|
18
|
+
ExpirationInDays: 365
|
|
19
|
+
|
|
20
|
+
PiiResponseHeadersPolicy:
|
|
21
|
+
Type: AWS::CloudFront::ResponseHeadersPolicy
|
|
22
|
+
Properties:
|
|
23
|
+
ResponseHeadersPolicyConfig:
|
|
24
|
+
Name: !Sub "${AWS::StackName}-pii-headers"
|
|
25
|
+
SecurityHeadersConfig:
|
|
26
|
+
StrictTransportSecurity:
|
|
27
|
+
AccessControlMaxAgeSec: 63072000
|
|
28
|
+
IncludeSubdomains: true
|
|
29
|
+
Override: true
|
|
30
|
+
ContentTypeOptions:
|
|
31
|
+
Override: true
|
|
32
|
+
FrameOptions:
|
|
33
|
+
FrameOption: DENY
|
|
34
|
+
Override: true
|
|
35
|
+
ReferrerPolicy:
|
|
36
|
+
ReferrerPolicy: same-origin
|
|
37
|
+
Override: true
|
|
38
|
+
XSSProtection:
|
|
39
|
+
ModeBlock: true
|
|
40
|
+
Protection: true
|
|
41
|
+
Override: true
|
|
42
|
+
|
|
43
|
+
PiiWebAcl:
|
|
44
|
+
Type: AWS::WAFv2::WebACL
|
|
45
|
+
Properties:
|
|
46
|
+
Name: !Sub "${AWS::StackName}-pii-waf"
|
|
47
|
+
Scope: CLOUDFRONT
|
|
48
|
+
DefaultAction:
|
|
49
|
+
Allow: {}
|
|
50
|
+
VisibilityConfig:
|
|
51
|
+
SampledRequestsEnabled: true
|
|
52
|
+
CloudWatchMetricsEnabled: true
|
|
53
|
+
MetricName: !Sub "${AWS::StackName}PiiWebAcl"
|
|
54
|
+
Rules:
|
|
55
|
+
- Name: AWSManagedRulesCommonRuleSet
|
|
56
|
+
Priority: 0
|
|
57
|
+
OverrideAction:
|
|
58
|
+
None: {}
|
|
59
|
+
Statement:
|
|
60
|
+
ManagedRuleGroupStatement:
|
|
61
|
+
VendorName: AWS
|
|
62
|
+
Name: AWSManagedRulesCommonRuleSet
|
|
63
|
+
VisibilityConfig:
|
|
64
|
+
SampledRequestsEnabled: true
|
|
65
|
+
CloudWatchMetricsEnabled: true
|
|
66
|
+
MetricName: !Sub "${AWS::StackName}PiiCommonRuleSet"
|
|
67
|
+
- Name: AWSManagedRulesKnownBadInputsRuleSet
|
|
68
|
+
Priority: 1
|
|
69
|
+
OverrideAction:
|
|
70
|
+
None: {}
|
|
71
|
+
Statement:
|
|
72
|
+
ManagedRuleGroupStatement:
|
|
73
|
+
VendorName: AWS
|
|
74
|
+
Name: AWSManagedRulesKnownBadInputsRuleSet
|
|
75
|
+
VisibilityConfig:
|
|
76
|
+
SampledRequestsEnabled: true
|
|
77
|
+
CloudWatchMetricsEnabled: true
|
|
78
|
+
MetricName: !Sub "${AWS::StackName}PiiKnownBadInputs"
|
|
79
|
+
|
|
80
|
+
@@origin_access_control@@
|
|
81
|
+
PiiDistribution:
|
|
82
|
+
Type: AWS::CloudFront::Distribution
|
|
83
|
+
Properties:
|
|
84
|
+
DistributionConfig:
|
|
85
|
+
Enabled: true
|
|
86
|
+
HttpVersion: http2
|
|
87
|
+
WebACLId: !GetAtt PiiWebAcl.Arn
|
|
88
|
+
Restrictions:
|
|
89
|
+
GeoRestriction:
|
|
90
|
+
RestrictionType: @@geo_restriction_type@@
|
|
91
|
+
Locations:@@geo_locations@@
|
|
92
|
+
Logging:
|
|
93
|
+
Bucket: !GetAtt PiiAccessLogsBucket.RegionalDomainName
|
|
94
|
+
IncludeCookies: false
|
|
95
|
+
Prefix: cloudfront/
|
|
96
|
+
Origins:
|
|
97
|
+
- Id: PiiOrigin
|
|
98
|
+
# `!Select [2, !Split ["/", ...]]` — the standard AWS-documented
|
|
99
|
+
# way to pull the bare hostname out of a Function URL's own
|
|
100
|
+
# `https://<id>.lambda-url.<region>.on.aws/` shape for use as a
|
|
101
|
+
# CustomOriginConfig DomainName, which admits no scheme or path.
|
|
102
|
+
DomainName: !Select [2, !Split ["/", !GetAtt @@fronted_logical_id@@Url.FunctionUrl]]
|
|
103
|
+
CustomOriginConfig:
|
|
104
|
+
OriginProtocolPolicy: https-only
|
|
105
|
+
OriginSSLProtocols: [TLSv1.2]
|
|
106
|
+
@@oac_reference@@
|
|
107
|
+
DefaultCacheBehavior:
|
|
108
|
+
TargetOriginId: PiiOrigin
|
|
109
|
+
ViewerProtocolPolicy: redirect-to-https
|
|
110
|
+
AllowedMethods: [GET, HEAD, OPTIONS, PUT, PATCH, POST, DELETE]
|
|
111
|
+
CachedMethods: [GET, HEAD]
|
|
112
|
+
CachePolicyId: 4135ea2d-6df8-44a3-9df3-4b5a84be39ad
|
|
113
|
+
OriginRequestPolicyId: 216adef6-5c7f-47e4-b989-5492eafa07d3
|
|
114
|
+
ResponseHeadersPolicyId: !Ref PiiResponseHeadersPolicy
|
|
115
|
+
|
|
116
|
+
@@invoke_permission@@
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# THE TRANSACTION-SAFETY GAP, closed for the case that actually
|
|
2
|
+
# matters: `sam deploy` below is what flips this Lambda's own
|
|
3
|
+
# HECKS_DOMAIN/HECKS_SCHEMA env vars live — the INSTANT it
|
|
4
|
+
# completes, real traffic can hit a domain/schema combination
|
|
5
|
+
# whose era history hasn't been bridged yet if THIS domain was
|
|
6
|
+
# just renamed (formerly_known_as) or its schema just moved.
|
|
7
|
+
# `mint-era` already bridges that (era_resolver.rb's own
|
|
8
|
+
# rename_domain! path, idempotent either way) — it only ran
|
|
9
|
+
# AFTER `sam deploy` before this existed, which is exactly the
|
|
10
|
+
# order that left a real live window open the one time this was
|
|
11
|
+
# actually run in anger (an SSM tunnel flaked mid-bridge, after
|
|
12
|
+
# the Lambda had already flipped over).
|
|
13
|
+
#
|
|
14
|
+
# STILL RUNS AFTER TOO (unchanged, below) — this pre-check
|
|
15
|
+
# cannot replace that: a domain's VERY FIRST deploy has no
|
|
16
|
+
# stack, hence no RDS, hence nothing to tunnel to yet, so
|
|
17
|
+
# mint-era's real first run has to stay where it always was,
|
|
18
|
+
# once `sam deploy` has just created that RDS instance. This
|
|
19
|
+
# only ADDS a second, EARLIER run for a domain that already has
|
|
20
|
+
# a live stack (a rename or an ordinary redeploy) — cheap and
|
|
21
|
+
# safe either way, since mint-era's own quiet-reboot path is a
|
|
22
|
+
# no-op the moment nothing has actually changed.
|
|
23
|
+
#
|
|
24
|
+
# See predeploy_bridge_shell's own comment (hecks deploy project,
|
|
25
|
+
# above, right before deploy_recipe_lines) for why this branches
|
|
26
|
+
# on google_oauth_present at all -- the short version: adding
|
|
27
|
+
# Google OAuth to an EXISTING stack would otherwise deadlock this
|
|
28
|
+
# exact pre-check against outputs the upcoming sam deploy (not
|
|
29
|
+
# yet run) hasn't created.
|
|
30
|
+
@@predeploy_bridge_shell@@
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@echo "Checking whether $(STACK) already exists, and if so whether it already has Google OAuth's PublicSubnetId/BastionSubnetId outputs, before deciding whether to bridge era history now or let this deploy create them first..."
|
|
2
|
+
@if aws cloudformation describe-stacks --stack-name $(STACK) >/dev/null 2>&1; then \
|
|
3
|
+
OAUTH_OUTPUTS_READY=$$(aws cloudformation describe-stacks --stack-name $(STACK) --query "Stacks[0].Outputs[?OutputKey=='PublicSubnetId'].OutputValue" --output text 2>/dev/null); \
|
|
4
|
+
if [ -z "$$OAUTH_OUTPUTS_READY" ]; then \
|
|
5
|
+
echo "Existing stack found, but Google OAuth is newly being added -- PublicSubnetId/BastionSubnetId don't exist on it yet (sam deploy, below, is what creates them); skipping the pre-deploy bridge this one time so THIS deploy can actually run. mint-era still runs once, after sam deploy, same as a genuine first deploy."; \
|
|
6
|
+
else \
|
|
7
|
+
echo "Existing stack found -- bridging era history before this deploy flips $(STACK) over, not after."; \
|
|
8
|
+
$(MAKE) mint-era || exit 1; \
|
|
9
|
+
fi; \
|
|
10
|
+
else \
|
|
11
|
+
echo "No existing stack -- first deploy, nothing to bridge yet; mint-era runs once, below, after the stack (and its RDS instance) exist."; \
|
|
12
|
+
fi
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
@echo "Checking whether $(STACK) already exists, to decide whether this deploy needs to bridge era history before it flips the stack over..."
|
|
2
|
+
@if aws cloudformation describe-stacks --stack-name $(STACK) >/dev/null 2>&1; then \
|
|
3
|
+
echo "Existing stack found -- bridging era history before this deploy flips $(STACK) over, not after."; \
|
|
4
|
+
$(MAKE) mint-era || exit 1; \
|
|
5
|
+
else \
|
|
6
|
+
echo "No existing stack -- first deploy, nothing to bridge yet; mint-era runs once, below, after the stack (and its RDS instance) exist."; \
|
|
7
|
+
fi
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# THE WHOLE TUNNEL IS RESTARTED PER ATTEMPT, not just probed once
|
|
2
|
+
# through a single long-lived session — confirmed live, the hard
|
|
3
|
+
# way: an SSM port-forwarding session can start and then exit
|
|
4
|
+
# again within seconds, not merely "slow to become ready". Probing
|
|
5
|
+
# the same dead tunnel five times fails identically every time,
|
|
6
|
+
# for a different reason than the retry was built for. Without
|
|
7
|
+
# this restart, a still-dead tunnel also doesn't just fail loudly
|
|
8
|
+
# — `EXISTS_OLD`/`EXISTS_NEW` would both come back empty, which the
|
|
9
|
+
# branch below reads as "neither schema exists" and reports as if
|
|
10
|
+
# that were the real answer, not a connectivity failure wearing
|
|
11
|
+
# its name — which is exactly why `TUNNEL_READY` gates that branch
|
|
12
|
+
# explicitly rather than trusting empty results at face value.
|
|
13
|
+
#
|
|
14
|
+
# OLD/NEW ARE ALLOWLISTED AS BARE IDENTIFIERS, not SQL-escaped, before
|
|
15
|
+
# either one reaches a psql command line: both get interpolated
|
|
16
|
+
# straight into the `nspname = '...'` lookups above and the
|
|
17
|
+
# `ALTER SCHEMA "..." RENAME TO "..."` below, and a schema name can't
|
|
18
|
+
# be bound as a parameter the way a value can — quoting/escaping an
|
|
19
|
+
# identifier is exactly the kind of thing that's easy to get subtly
|
|
20
|
+
# wrong, so instead of trying, this refuses anything that isn't
|
|
21
|
+
# `^[A-Za-z_][A-Za-z0-9_]*$` outright. `make` runs this recipe as an
|
|
22
|
+
# operator command, not user-facing web input, but it still executes
|
|
23
|
+
# against production RDS, so a typo'd or copy-pasted `OLD`/`NEW`
|
|
24
|
+
# containing quotes or `;` must fail loudly here, before either
|
|
25
|
+
# tunnel or query, rather than run as-is.
|
|
26
|
+
#
|
|
27
|
+
# `$$OLD`/`$$NEW` HERE, NOT `$(OLD)`/`$(NEW)`: this check itself has
|
|
28
|
+
# to read the value without Make ever splicing its raw text into the
|
|
29
|
+
# recipe line, or a value containing `;`/`"` would break out of THIS
|
|
30
|
+
# line's shell command and run before the pattern match ever sees it
|
|
31
|
+
# — confirmed live, the same way the tunnel-restart behavior above
|
|
32
|
+
# was. `$$OLD` instead reads the real shell environment variable
|
|
33
|
+
# `make` already exports for command-line-assigned vars, so the
|
|
34
|
+
# value is one opaque string to the shell no matter what characters
|
|
35
|
+
# it contains. Once a value's passed this gate it's provably just
|
|
36
|
+
# `[A-Za-z0-9_]`, so the existing `$(OLD)`/`$(NEW)` splices further
|
|
37
|
+
# below (already written before this fix, reused as-is) are safe.
|
|
38
|
+
@[ -n "$$OLD" ] && [ -n "$$NEW" ] || { echo "usage: make rename-schema OLD=<old-schema> NEW=<new-schema>"; exit 1; }
|
|
39
|
+
@echo "$$OLD" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*$$' || { echo "invalid OLD schema name -- schema names must match ^[A-Za-z_][A-Za-z0-9_]*$$, refusing to touch SQL"; exit 1; }
|
|
40
|
+
@echo "$$NEW" | grep -Eq '^[A-Za-z_][A-Za-z0-9_]*$$' || { echo "invalid NEW schema name -- schema names must match ^[A-Za-z_][A-Za-z0-9_]*$$, refusing to touch SQL"; exit 1; }
|
|
41
|
+
@echo "Looking up $(STACK)'s VPC/security group..."
|
|
42
|
+
@@eval_lines@@
|
|
43
|
+
@echo "Deploying the temporary bastion stack $(BASTION_STACK)..."
|
|
44
|
+
aws cloudformation deploy --template-file bastion.yaml --stack-name $(BASTION_STACK) \
|
|
45
|
+
--parameter-overrides @@parameter_overrides@@ \
|
|
46
|
+
--capabilities CAPABILITY_IAM
|
|
47
|
+
@INSTANCE_ID=$$(aws cloudformation describe-stacks --stack-name $(BASTION_STACK) --query "Stacks[0].Outputs[?OutputKey=='InstanceId'].OutputValue" --output text); \
|
|
48
|
+
echo "Waiting for $$INSTANCE_ID to register with SSM..."; \
|
|
49
|
+
for i in $$(seq 1 30); do \
|
|
50
|
+
STATUS=$$(aws ssm describe-instance-information --filters "Key=InstanceIds,Values=$$INSTANCE_ID" --query "InstanceInformationList[0].PingStatus" --output text 2>/dev/null); \
|
|
51
|
+
if [ "$$STATUS" = "Online" ]; then break; fi; \
|
|
52
|
+
sleep 5; \
|
|
53
|
+
done; \
|
|
54
|
+
DB_PASS=$$(aws secretsmanager get-secret-value --secret-id $(DB_SECRET_ARN) --query SecretString --output text | ruby -rjson -e 'print JSON.parse(STDIN.read)["password"]'); \
|
|
55
|
+
TUNNEL_READY=1; \
|
|
56
|
+
for attempt in 1 2 3 4 5; do \
|
|
57
|
+
kill $$TUNNEL_PID 2>/dev/null; \
|
|
58
|
+
echo "Opening an SSM tunnel to $(DB_HOST):5432 (attempt $$attempt/5)..."; \
|
|
59
|
+
aws ssm start-session --target $$INSTANCE_ID \
|
|
60
|
+
--document-name AWS-StartPortForwardingSessionToRemoteHost \
|
|
61
|
+
--parameters "{\"host\":[\"$(DB_HOST)\"],\"portNumber\":[\"5432\"],\"localPortNumber\":[\"15432\"]}" \
|
|
62
|
+
>/tmp/$(BASTION_STACK)-tunnel-$$attempt.log 2>&1 & \
|
|
63
|
+
TUNNEL_PID=$$!; \
|
|
64
|
+
for i in $$(seq 1 15); do \
|
|
65
|
+
nc -z localhost 15432 2>/dev/null && break; \
|
|
66
|
+
sleep 1; \
|
|
67
|
+
done; \
|
|
68
|
+
PGPASSWORD=$$DB_PASS psql -h localhost -p 15432 -U postgres -d @@db_name@@ -tAc "SELECT 1" >/dev/null 2>&1 && { TUNNEL_READY=0; break; }; \
|
|
69
|
+
echo "tunnel not carrying real traffic yet (attempt $$attempt/5) -- restarting the tunnel and retrying in 3s..."; \
|
|
70
|
+
sleep 3; \
|
|
71
|
+
done; \
|
|
72
|
+
EXISTS_OLD=$$(PGPASSWORD=$$DB_PASS psql -h localhost -p 15432 -U postgres -d @@db_name@@ -tAc "SELECT 1 FROM pg_namespace WHERE nspname = '$(OLD)'"); \
|
|
73
|
+
EXISTS_NEW=$$(PGPASSWORD=$$DB_PASS psql -h localhost -p 15432 -U postgres -d @@db_name@@ -tAc "SELECT 1 FROM pg_namespace WHERE nspname = '$(NEW)'"); \
|
|
74
|
+
if [ "$$TUNNEL_READY" != "0" ]; then \
|
|
75
|
+
echo "tunnel never carried a real connection -- aborting without touching either schema"; \
|
|
76
|
+
BOOT_STATUS=1; \
|
|
77
|
+
elif [ "$$EXISTS_NEW" = "1" ]; then \
|
|
78
|
+
echo "schema $(NEW) already exists -- already renamed, no-op"; \
|
|
79
|
+
BOOT_STATUS=0; \
|
|
80
|
+
elif [ "$$EXISTS_OLD" = "1" ]; then \
|
|
81
|
+
PGPASSWORD=$$DB_PASS psql -h localhost -p 15432 -U postgres -d @@db_name@@ -v ON_ERROR_STOP=1 -c "ALTER SCHEMA \"$(OLD)\" RENAME TO \"$(NEW)\""; \
|
|
82
|
+
BOOT_STATUS=$$?; \
|
|
83
|
+
echo "renamed schema $(OLD) to $(NEW) (exit $$BOOT_STATUS)"; \
|
|
84
|
+
else \
|
|
85
|
+
echo "neither schema $(OLD) nor $(NEW) exists on @@db_name@@ -- nothing to rename"; \
|
|
86
|
+
BOOT_STATUS=1; \
|
|
87
|
+
fi; \
|
|
88
|
+
kill $$TUNNEL_PID 2>/dev/null; \
|
|
89
|
+
echo "Tearing down the temporary bastion stack..."; \
|
|
90
|
+
aws cloudformation delete-stack --stack-name $(BASTION_STACK); \
|
|
91
|
+
aws cloudformation wait stack-delete-complete --stack-name $(BASTION_STACK); \
|
|
92
|
+
echo "$(BASTION_STACK) deleted."; \
|
|
93
|
+
exit $$BOOT_STATUS
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# NOT AUTOMATED for a Shared-mode domain, same reason mint-era
|
|
2
|
+
# isn't: there is no bastion.yaml here to stand up next to (this
|
|
3
|
+
# domain has no RDS/VPC of its own). This domain's own schema
|
|
4
|
+
# lives inside @@owner_domain_name@@'s database — run this same
|
|
5
|
+
# target from @@owner_domain_name@@'s own deploy directory instead.
|
|
6
|
+
@echo "rename-schema isn't automated for a Shared-mode domain (database \"Shared\") -- run it from @@owner_domain_name@@'s own deploy directory instead, which owns the RDS instance this domain's schema actually lives on."; \
|
|
7
|
+
exit 1
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# NOT `{{resolve:secretsmanager:...}}` composing
|
|
2
|
+
# GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET/SESSION_SECRET
|
|
3
|
+
# directly anymore -- the identical GetFunctionConfiguration
|
|
4
|
+
# exposure DATABASE_URL's own comment above documents
|
|
5
|
+
# applied here too. main.rs's own cold start fetches both
|
|
6
|
+
# secrets itself and `set_var`s the real GOOGLE_CLIENT_ID/
|
|
7
|
+
# GOOGLE_CLIENT_SECRET/SESSION_SECRET keys before anything
|
|
8
|
+
# else runs -- auth.rs/web.rs still read those exact keys,
|
|
9
|
+
# unchanged. GOOGLE_OAUTH_SECRET_ID is a bare NAME (`make
|
|
10
|
+
# sync-google-oauth` owns @@stack_name@@-web-google-oauth's
|
|
11
|
+
# whole lifecycle outside CloudFormation, straight from
|
|
12
|
+
# @@domain@@'s own gitignored .env.local, never baked into
|
|
13
|
+
# this generated, git-tracked template as plaintext) --
|
|
14
|
+
# GetSecretValue accepts a name directly, no ARN needed.
|
|
15
|
+
GOOGLE_OAUTH_SECRET_ID: @@stack_name@@-web-google-oauth
|
|
16
|
+
GOOGLE_REDIRECT_URI: !Sub "${WebRedirectBaseUrl}/auth/google/callback"
|
|
17
|
+
SESSION_SECRET_ARN: !Sub "${@@logical_id@@SessionSecret}"
|