diff --git a/dag/examples/cost_estimate/cost_estimate.dag b/dag/examples/cost_estimate/cost_estimate.dag index 16f5f6ad736..dc23908dec1 100644 --- a/dag/examples/cost_estimate/cost_estimate.dag +++ b/dag/examples/cost_estimate/cost_estimate.dag @@ -1,5 +1,9 @@ module examples.cost_estimate - +import std.currency { + CurrencyCode, + Usd, + currency_minor_unit_exponent, +} type CostProjection { expected_hours: Float diff --git a/dag/examples/gunbhub_serve_program/gunbhub_serve_program.dag b/dag/examples/gunbhub_serve_program/gunbhub_serve_program.dag index 1f3a5d43b48..34eff28eef2 100644 --- a/dag/examples/gunbhub_serve_program/gunbhub_serve_program.dag +++ b/dag/examples/gunbhub_serve_program/gunbhub_serve_program.dag @@ -1,5 +1,28 @@ module examples.gunbhub_serve_program - +import gunbc.gunbhub_serve { + GunbhubServeRequest, + GunbhubServeResult, + serve_gunbhub_request, + serve_gunbhub_page_source, + gunbhub_hostile_page, + ReactPage, + Served, + RouteNotFound, + RenderRejectedBeforeServe, + MethodNotAllowed, +} +import extdeps.languages.html { + try_serialize_html_source, + EmitOk, + EmitRejected, +} +import std.types { GET } +import std.process { + ProcessExit, + ExitSuccess, + ExitFailure, +} +import extdeps.process.posix_exit { exit_code_general_error } fn wa_unknown_path_is_not_found() -> Bool { match serve_gunbhub_request( diff --git a/dag/examples/interp_test/interp_example.dag b/dag/examples/interp_test/interp_example.dag index fef531dcec7..fd16a663a7b 100644 --- a/dag/examples/interp_test/interp_example.dag +++ b/dag/examples/interp_test/interp_example.dag @@ -1,4 +1,8 @@ module examples.interp_test +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/examples/js_site/js_site.dag b/dag/examples/js_site/js_site.dag index f2129223b77..66c584d5947 100644 --- a/dag/examples/js_site/js_site.dag +++ b/dag/examples/js_site/js_site.dag @@ -1,5 +1,15 @@ module examples.js_site - +import std.markup { + Element, + Fragment, + FragmentText, + attr, +} +import std.decl_ref { DeclarationRef } +import std.disposition { + Disposition, + Scaffold, +} type JsSitePageId = Home | Browse | About diff --git a/dag/examples/js_site/js_site_emit.dag b/dag/examples/js_site/js_site_emit.dag index 020716f8889..6433b5d01da 100644 --- a/dag/examples/js_site/js_site_emit.dag +++ b/dag/examples/js_site/js_site_emit.dag @@ -1,5 +1,30 @@ module examples.js_site_emit - +import examples.js_site { + JsSitePageId, + JsSitePage, + Home, + About, + Browse, + js_site_pages, +} +import extdeps.languages.html { + HtmlEmitResult, + EmitOk, + EmitRejected, + try_serialize_html_source, +} +import extdeps.languages.react_jsx { + JsxEmitResult, + JsxOk, + JsxRejected, + try_serialize_jsx_component, +} +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import extdeps.filesystem.filesystem_io { Filesystem } fn js_site_generated_dir() -> String { "dag/examples/js_site/generated" diff --git a/dag/extdeps/access/aws_iam.dag b/dag/extdeps/access/aws_iam.dag index f7db97c1edf..f78f213ca6e 100644 --- a/dag/extdeps/access/aws_iam.dag +++ b/dag/extdeps/access/aws_iam.dag @@ -1,5 +1,8 @@ module extdeps.access.aws_iam +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/access/posix.dag b/dag/extdeps/access/posix.dag index f79f3163443..e7c2deeb29d 100644 --- a/dag/extdeps/access/posix.dag +++ b/dag/extdeps/access/posix.dag @@ -1,5 +1,8 @@ module extdeps.access.posix +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/access/rbac.dag b/dag/extdeps/access/rbac.dag index f00ea0681a9..ca5683dde6c 100644 --- a/dag/extdeps/access/rbac.dag +++ b/dag/extdeps/access/rbac.dag @@ -1,5 +1,8 @@ module extdeps.access.rbac +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/access/zanzibar.dag b/dag/extdeps/access/zanzibar.dag index 35533bb0dad..5cce0062bcf 100644 --- a/dag/extdeps/access/zanzibar.dag +++ b/dag/extdeps/access/zanzibar.dag @@ -1,5 +1,8 @@ module extdeps.access.zanzibar +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/audit/cloudevents.dag b/dag/extdeps/audit/cloudevents.dag index 40c77f3c697..f543a850414 100644 --- a/dag/extdeps/audit/cloudevents.dag +++ b/dag/extdeps/audit/cloudevents.dag @@ -1,5 +1,8 @@ module extdeps.audit.cloudevents +import std.types { NonEmptyStr, Timestamp } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc.dag b/dag/extdeps/bmc.dag index 4686198c1d1..ab963a699be 100644 --- a/dag/extdeps/bmc.dag +++ b/dag/extdeps/bmc.dag @@ -1,5 +1,11 @@ module extdeps.bmc +import extdeps.bmc.types { BmcGroundedHostObservations, BmcTelemetrySnapshot } +import extdeps.bmc.redfish { bmc_ground_host_observations } +import std.measure { ByteSize, Watt, HardwareThreadCount } +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/access.dag b/dag/extdeps/bmc/access.dag index 4213e71475a..fb40d03bfc4 100644 --- a/dag/extdeps/bmc/access.dag +++ b/dag/extdeps/bmc/access.dag @@ -1,5 +1,23 @@ module extdeps.bmc.access +import extdeps.access.rbac { Permission, PermissionAssignment, RbacPolicy } +import extdeps.bmc.types { + RedfishAccountRole, + AccountRoleAdministrator, + AccountRoleOperator, + AccountRoleReadOnly, + redfish_account_role_wire, + RedfishPrivilege, + PrivilegeLogin, + PrivilegeConfigureManager, + PrivilegeConfigureUsers, + PrivilegeConfigureComponents, + PrivilegeConfigureSelf, + redfish_privilege_wire, +} +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/capability.dag b/dag/extdeps/bmc/capability.dag index 953409d5601..9515de37958 100644 --- a/dag/extdeps/bmc/capability.dag +++ b/dag/extdeps/bmc/capability.dag @@ -3,6 +3,8 @@ module extdeps.bmc.capability import std.bmc { BmcFirmwareFamily, BmcEndpoint } import std.nat { Nat } import std.types { Bool, EpochMs, Int, List, NonEmptyStr, String } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/http.dag b/dag/extdeps/bmc/http.dag index 25ab039db59..a6db36b0965 100644 --- a/dag/extdeps/bmc/http.dag +++ b/dag/extdeps/bmc/http.dag @@ -1,5 +1,10 @@ module extdeps.bmc.http +import std.types { NonEmptyStr, Secret, String } +import std.disposition { Disposition, Scaffold, RealizationDispatch } +import std.decl_ref { DeclarationRef, WholeDeclaration } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/ipmi.dag b/dag/extdeps/bmc/ipmi.dag index 5e041d81b92..a631f4c6782 100644 --- a/dag/extdeps/bmc/ipmi.dag +++ b/dag/extdeps/bmc/ipmi.dag @@ -1,5 +1,10 @@ module extdeps.bmc.ipmi - +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { + Uri, + Https, +} data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/openbmc.dag b/dag/extdeps/bmc/openbmc.dag index 58cfae488c1..9dc61386765 100644 --- a/dag/extdeps/bmc/openbmc.dag +++ b/dag/extdeps/bmc/openbmc.dag @@ -1,5 +1,10 @@ module extdeps.bmc.openbmc +import std.bmc { BmcFirmwareFamily, OpenBmc, BmcProtocol, Redfish, Ipmi } +import std.credentials { FactoryLogin } +import std.types { List } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/os_install_actuator_toolchain.dag b/dag/extdeps/bmc/os_install_actuator_toolchain.dag index efa066ee9c4..5f082945c77 100644 --- a/dag/extdeps/bmc/os_install_actuator_toolchain.dag +++ b/dag/extdeps/bmc/os_install_actuator_toolchain.dag @@ -1,5 +1,20 @@ module extdeps.bmc.os_install_actuator_toolchain - +import std.types { + Bool, + List, + NonEmptyStr, +} +import extdeps.tools { CliTool } +import extdeps.tools.curl { curl_cli_tool } +import extdeps.tools.websocat { websocat_cli_tool } +import extdeps.tools.nbdkit { nbdkit_cli_tool } +import extdeps.tools.socat { socat_cli_tool } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { + Https, + Uri, +} +import extdeps.tools.gcloud { gcloud_cli_tool } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/redfish.dag b/dag/extdeps/bmc/redfish.dag index 5d467f990d0..86e958b985f 100644 --- a/dag/extdeps/bmc/redfish.dag +++ b/dag/extdeps/bmc/redfish.dag @@ -1,5 +1,32 @@ module extdeps.bmc.redfish +import extdeps.bmc.types { + BmcGroundedHostObservations, + BmcTelemetrySnapshot, + RedfishChassisSensorCollection, + RedfishMemorySummary, + RedfishPowerControl, + RedfishPowerSubsystem, + RedfishProcessorSummary, + RedfishSensorReading, + RedfishSystemInventory, + RedfishPowerState, +} +import std.measure { + ByteSize, + Watt, + HardwareThreadCount, + Gibibyte, + gibibyte, + gibibyte_to_byte_size, + byte_size, + watt, + watt_count, + byte_size_count, +} +import std.types { Int, List, NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/serial_console.dag b/dag/extdeps/bmc/serial_console.dag index bc589b452d0..681beba4aa3 100644 --- a/dag/extdeps/bmc/serial_console.dag +++ b/dag/extdeps/bmc/serial_console.dag @@ -1,5 +1,11 @@ module extdeps.bmc.serial_console +import std.disposition { Disposition, RealizationDispatch, Scaffold } +import std.decl_ref { DeclarationRef, WholeDeclaration } +import std.types { NonEmptyStr, String, Milliseconds } +import std.measure { ByteSize } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/types.dag b/dag/extdeps/bmc/types.dag index 676a27b2147..7079559a981 100644 --- a/dag/extdeps/bmc/types.dag +++ b/dag/extdeps/bmc/types.dag @@ -19,7 +19,9 @@ import std.measure { percent_count, } import std.nat { Nat } -import std.types { Bool, EpochMs, HttpStatus, Int, List, NonEmptyStr } +import std.types { Bool, EpochMs, HttpStatus, Int, List, NonEmptyStr, Secret } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/webui/nbd_proxy.dag b/dag/extdeps/bmc/webui/nbd_proxy.dag index ae8c68d9365..7300fe87b21 100644 --- a/dag/extdeps/bmc/webui/nbd_proxy.dag +++ b/dag/extdeps/bmc/webui/nbd_proxy.dag @@ -1,5 +1,16 @@ module extdeps.bmc.webui.nbd_proxy +import std.types { Int, List, Bool, NonEmptyStr } +import std.measure { ByteSize } +import std.http_path { + PathTemplate, + LiteralToken, + ParamToken, + PathParamBinding, + render_path_template, +} +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/bmc/webui/nbd_proxy_serve.dag b/dag/extdeps/bmc/webui/nbd_proxy_serve.dag index 8ef8fe0eff3..73229a52967 100644 --- a/dag/extdeps/bmc/webui/nbd_proxy_serve.dag +++ b/dag/extdeps/bmc/webui/nbd_proxy_serve.dag @@ -1,5 +1,25 @@ module extdeps.bmc.webui.nbd_proxy_serve +import std.disposition { Disposition, RealizationDispatch, Scaffold } +import std.decl_ref { DeclarationRef, WholeDeclaration } + +import std.types { NonEmptyStr, Int, String, List } +import std.logic { Bool } +import extdeps.external_authority { ExternalAuthority } +import extdeps.tools.curl { curl_cli_tool } +import extdeps.tools.websocat { websocat_cli_tool, websocat_install_path } +import extdeps.tools.nbdkit { nbdkit_cli_tool } +import extdeps.tools.socat { socat_cli_tool } +import extdeps.bmc.webui.nbd_proxy { + nbd_proxy_role_assignment, + NbdServer, +} +import extdeps.bmc.virtual_media { + VirtualMediaIntent, + NbdProxyWebsocatParams, + virtual_media_source_iso, +} +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/boards/asrock_rack.dag b/dag/extdeps/boards/asrock_rack.dag index 2c40ba4fc4a..0402c871f1c 100644 --- a/dag/extdeps/boards/asrock_rack.dag +++ b/dag/extdeps/boards/asrock_rack.dag @@ -1,6 +1,6 @@ module extdeps.boards.asrock_rack -import extdeps.boards.types { BaseboardCatalogRow } +import extdeps.boards.types { BaseboardCatalogRow, AsrockRackAltrad8ud1l2t } import extdeps.vendor.asrock_rack { asrock_rack } import extdeps.bmc.webui.nbd_proxy { BmcwebNbdProxyEndpointVariant, VmSlotIndexEndpoint, NbdSlotEndpoint } import extdeps.bmc.types { @@ -15,7 +15,20 @@ import extdeps.bmc.capability { BmcFirmwareSemanticVersion, HistoricalEvidenceSnapshot, bmc_firmware_semantic_version, + BmcCapability, + BmcFirmwareCapabilityRow, + BmcFirmwareVersion, + CapabilityPowerControl, + CapabilityBootSourceOverride, + CapabilityAccountManagement, + CapabilityFirmwareUpdate, + CapabilityNbdProxyVirtualMedia, + CapabilitySerialConsole, } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } +import std.types { NonEmptyStr, List, Bool } +import std.bmc { OpenBmc } import std.measure { celsius, percent, positive_celsius_delta, positive_measure_count } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { diff --git a/dag/extdeps/boot/emit.dag b/dag/extdeps/boot/emit.dag index 4d67e60aa9a..4b4578057db 100644 --- a/dag/extdeps/boot/emit.dag +++ b/dag/extdeps/boot/emit.dag @@ -1,5 +1,34 @@ module extdeps.boot.emit +import extdeps.boot.framebuffer { vga_text_mode_base } +import extdeps.boot.freestanding_payload { + EmittedPayload, + FreestandingPayloadRef, + HollowPrebuiltInit, + PrebuiltPayload, +} +import extdeps.formats.elf.encode { encode_elf64_ehdr, encode_elf64_phdr } +import extdeps.formats.elf.primitives { + ElfClass64, + ElfData2Lsb, + EtExec, + EmX86_64, + PtLoad, + elf64_phdr_size, + elf64_ehdr_size, + elf_mag0, + elf_mag1, + elf_mag2, + elf_mag3, + pf_r, + pf_x, +} +import extdeps.formats.elf.segments { Elf64Phdr } +import extdeps.formats.elf.types { Elf64Ehdr, ElfIdent, byte_at_in_bounds } +import std.exec_format { EntryPoint } +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/boot/framebuffer.dag b/dag/extdeps/boot/framebuffer.dag index c8c84a97f1a..eb33d8d2d82 100644 --- a/dag/extdeps/boot/framebuffer.dag +++ b/dag/extdeps/boot/framebuffer.dag @@ -1,5 +1,7 @@ module extdeps.boot.framebuffer +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/boot/freestanding_payload.dag b/dag/extdeps/boot/freestanding_payload.dag index 4590c2a0b2b..72c3b7bfb09 100644 --- a/dag/extdeps/boot/freestanding_payload.dag +++ b/dag/extdeps/boot/freestanding_payload.dag @@ -1,5 +1,9 @@ module extdeps.boot.freestanding_payload +import std.exec_format { EntryPoint } +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/boot/freestanding_witness.dag b/dag/extdeps/boot/freestanding_witness.dag index 58be89db84f..25c73e6e70b 100644 --- a/dag/extdeps/boot/freestanding_witness.dag +++ b/dag/extdeps/boot/freestanding_witness.dag @@ -1,5 +1,65 @@ module extdeps.boot.freestanding_witness - +import extdeps.boot.emit { + emit_freestanding_elf64, + emit_pixel_writer_payload, + freestanding_code_file_offset, + freestanding_load_vaddr, + freestanding_phoff, + pixel_writer_code_bytes, + witness_emitted_digest_non_empty, + witness_emitted_file_size, + witness_pixel_writer_code_uses_vga_base, + witness_vga_base_matches_framebuffer_fact, +} +import extdeps.boot.freestanding_payload { + EmittedPayload, + HollowPrebuiltInit, + PrebuiltPayload, +} +import extdeps.boot.linux_x86_boot { + BootImageAccepted, + BootImageRejected, + LinuxX86BootImage, + accept_linux_x86_boot_image, +} +import extdeps.formats.elf.encode { + encode_elf64_ehdr, + encode_elf64_phdr, + int_lists_equal, + int_lists_equal_at, + witness_encode_decode_roundtrip_ehdr, +} +import extdeps.formats.elf.hello_static_witness { + static_hello_elf64_ehdr_bytes, + static_hello_first_phdr_bytes, +} +import extdeps.formats.elf.primitives { + EtExec, + EmX86_64, + PtLoad, + elf64_ehdr_size, + elf64_phdr_size, + pf_r, + pf_x, +} +import extdeps.formats.elf.types { + ElfDecoded, + ElfRejected, + byte_at_in_bounds, + decode_elf64_ehdr, + elf64_ehdr_entry_point, +} +import extdeps.formats.elf.segments { + decode_elf64_phdr, + elf64_phdr_to_load_segment, +} +import std.exec_format { EntryPoint } +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { + Uri, + Https, +} data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/boot/linux_x86_boot.dag b/dag/extdeps/boot/linux_x86_boot.dag index ac764817456..042a077f721 100644 --- a/dag/extdeps/boot/linux_x86_boot.dag +++ b/dag/extdeps/boot/linux_x86_boot.dag @@ -1,5 +1,14 @@ module extdeps.boot.linux_x86_boot +import extdeps.boot.freestanding_payload { + EmittedPayload, + FreestandingPayloadRef, + HollowPrebuiltInit, + PrebuiltPayload, +} +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/browser/browser.dag b/dag/extdeps/browser/browser.dag index ce393c9725a..8f23d371380 100644 --- a/dag/extdeps/browser/browser.dag +++ b/dag/extdeps/browser/browser.dag @@ -1,5 +1,8 @@ module extdeps.browser +import std.types { FilePath } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/clock/clock.dag b/dag/extdeps/clock/clock.dag index 1a87fb31e6b..db8b43a1151 100644 --- a/dag/extdeps/clock/clock.dag +++ b/dag/extdeps/clock/clock.dag @@ -1,5 +1,9 @@ module extdeps.clock +import std.types { Timestamp } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/cloud.dag b/dag/extdeps/cloud/cloud.dag index 26458a69927..1ea3be1ee86 100644 --- a/dag/extdeps/cloud/cloud.dag +++ b/dag/extdeps/cloud/cloud.dag @@ -1,5 +1,8 @@ module extdeps.cloud.cloud +import std.types { AuthScheme } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/auth_print_access_token.dag b/dag/extdeps/cloud/gcp/auth_print_access_token.dag index d13b9650d7f..c786206edb4 100644 --- a/dag/extdeps/cloud/gcp/auth_print_access_token.dag +++ b/dag/extdeps/cloud/gcp/auth_print_access_token.dag @@ -1,6 +1,8 @@ module extdeps.cloud.gcp.auth_print_access_token import std.types { List, String } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/errors.dag b/dag/extdeps/cloud/gcp/errors.dag index 0abcf5a9f51..c9ab012f390 100644 --- a/dag/extdeps/cloud/gcp/errors.dag +++ b/dag/extdeps/cloud/gcp/errors.dag @@ -1,5 +1,8 @@ module extdeps.cloud.gcp.errors +import std.types { NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/gcp.dag b/dag/extdeps/cloud/gcp/gcp.dag index 87309b20e6f..0108405c065 100644 --- a/dag/extdeps/cloud/gcp/gcp.dag +++ b/dag/extdeps/cloud/gcp/gcp.dag @@ -1,5 +1,11 @@ module extdeps.cloud.gcp.gcp +import extdeps.cloud.cloud { ServiceEndpoint } +import std.types { FilePath, NonEmptyStr, Secret, HttpMethod, AuthScheme } +import extdeps.cloud.gcp.errors { GcpErrorShape, GcpOAuth2ErrorShape } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/iam.dag b/dag/extdeps/cloud/gcp/iam.dag index 8498fe2df03..e502376feee 100644 --- a/dag/extdeps/cloud/gcp/iam.dag +++ b/dag/extdeps/cloud/gcp/iam.dag @@ -1,5 +1,10 @@ module extdeps.cloud.gcp.iam +import extdeps.cloud.gcp.gcp { GcpServiceAccount, GcpProject, GcpProjectId, ServiceAccountEmail } +import extdeps.cloud.gcp.errors { GcpErrorShape } +import std.types { HttpMethod, AuthScheme, NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/iam_admin.dag b/dag/extdeps/cloud/gcp/iam_admin.dag index 3f0703b7ec0..4c10b2b03d4 100644 --- a/dag/extdeps/cloud/gcp/iam_admin.dag +++ b/dag/extdeps/cloud/gcp/iam_admin.dag @@ -1,5 +1,10 @@ module extdeps.cloud.gcp.iam_admin +import extdeps.cloud.gcp.gcp { GcpProjectId, GcpServiceAccount, GcpOperation, ServiceAccountEmail } +import extdeps.cloud.gcp.errors { GcpErrorShape } +import std.types { HttpMethod, AuthScheme, NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/mock_corpus.dag b/dag/extdeps/cloud/gcp/mock_corpus.dag index 08719eef4a2..a4a3fc5a55f 100644 --- a/dag/extdeps/cloud/gcp/mock_corpus.dag +++ b/dag/extdeps/cloud/gcp/mock_corpus.dag @@ -1,5 +1,6 @@ module extdeps.cloud.gcp.mock_corpus +import std.hermetic_replay { PublishedMockCase } data gcloud_auth_mock_case_login: PublishedMockCase = PublishedMockCase { operation_key: "gcloud.Auth.Login", diff --git a/dag/extdeps/cloud/gcp/secret_manager.dag b/dag/extdeps/cloud/gcp/secret_manager.dag index caaa823b8c1..43f87205137 100644 --- a/dag/extdeps/cloud/gcp/secret_manager.dag +++ b/dag/extdeps/cloud/gcp/secret_manager.dag @@ -1,5 +1,12 @@ module extdeps.cloud.gcp.secret_manager +import extdeps.cloud.gcp.gcp { GcpProject, GcpProjectId } +import extdeps.cloud.gcp.iam { GcpBinding, GcpPolicy } +import extdeps.cloud.gcp.errors { GcpErrorShape } +import std.types { HttpMethod, AuthScheme, Bytes, Secret, NonEmptyStr } +import std.encoding { utf8_decode_bytes } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/secret_ref.dag b/dag/extdeps/cloud/gcp/secret_ref.dag index 43abc7fa8b6..8d8b411a0fc 100644 --- a/dag/extdeps/cloud/gcp/secret_ref.dag +++ b/dag/extdeps/cloud/gcp/secret_ref.dag @@ -1,5 +1,11 @@ module extdeps.cloud.gcp.secret_ref +import extdeps.cloud.gcp.gcp { GcpProjectId } +import std.types { NonEmptyStr, ContentHash, String } +import std.logic { Bool } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/serviceusage.dag b/dag/extdeps/cloud/gcp/serviceusage.dag index 7469114fe48..752f9be2acb 100644 --- a/dag/extdeps/cloud/gcp/serviceusage.dag +++ b/dag/extdeps/cloud/gcp/serviceusage.dag @@ -1,5 +1,10 @@ module extdeps.cloud.gcp.serviceusage +import extdeps.cloud.gcp.gcp { GcpProjectId, GcpOperation } +import extdeps.cloud.gcp.errors { GcpErrorShape } +import std.types { HttpMethod, AuthScheme } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/gcp/sts.dag b/dag/extdeps/cloud/gcp/sts.dag index 5ef9dbc6a49..77fcee7f056 100644 --- a/dag/extdeps/cloud/gcp/sts.dag +++ b/dag/extdeps/cloud/gcp/sts.dag @@ -1,5 +1,10 @@ module extdeps.cloud.gcp.sts +import std.types { NonEmptyStr, HttpMethod, AuthScheme, Secret } +import extdeps.cloud.gcp.errors { GcpErrorShape, GcpOAuth2ErrorShape } +import extdeps.github.errors { GitHubErrorShape } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/hetzner.dag b/dag/extdeps/cloud/hetzner.dag index 370c1b3eb4d..d72ae630db5 100644 --- a/dag/extdeps/cloud/hetzner.dag +++ b/dag/extdeps/cloud/hetzner.dag @@ -1,12 +1,17 @@ module extdeps.cloud.hetzner - import std.roster_frontier { FrontierRow, TriggerProse, decl_ref, frontier_row_decl, } - +import extdeps.toolchain.types { Architecture } +import std.measure { + ByteSize, + HardwareThreadCount, + MoneyAmountMicro, +} +import std.currency { CurrencyCode } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cloud/ubicloud.dag b/dag/extdeps/cloud/ubicloud.dag index cfda55ef18b..898a0af9e74 100644 --- a/dag/extdeps/cloud/ubicloud.dag +++ b/dag/extdeps/cloud/ubicloud.dag @@ -1,5 +1,16 @@ module extdeps.cloud.ubicloud +import extdeps.toolchain.types { Architecture, Aarch64, X86_64 } +import std.measure { + ByteSize, + byte_size, + HardwareThreadCount, + hardware_thread_count, +} +import std.types { NonEmptyStr } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/communication/fidelity_carriers.dag b/dag/extdeps/communication/fidelity_carriers.dag index 64b06f85317..95ac68a0f34 100644 --- a/dag/extdeps/communication/fidelity_carriers.dag +++ b/dag/extdeps/communication/fidelity_carriers.dag @@ -1,5 +1,9 @@ module extdeps.communication.fidelity_carriers +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } +import extdeps.communication.medium { DecodeFidelity, Lossless, Lossy, Medium } +import std.types { List } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/communication/medium.dag b/dag/extdeps/communication/medium.dag index a4a3f80fbc3..c23e62a547e 100644 --- a/dag/extdeps/communication/medium.dag +++ b/dag/extdeps/communication/medium.dag @@ -1,5 +1,7 @@ module extdeps.communication.medium +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/communication/numerical_fidelity.dag b/dag/extdeps/communication/numerical_fidelity.dag index ea3e940a89f..49ce3d2c952 100644 --- a/dag/extdeps/communication/numerical_fidelity.dag +++ b/dag/extdeps/communication/numerical_fidelity.dag @@ -1,5 +1,15 @@ module extdeps.communication.numerical_fidelity +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } +import extdeps.communication.medium { DecodeFidelity, Lossless, Lossy } +import std.numerical_contract { + NumericalContract, + IntegerExact, + FloatApproximate, + FmaContractionPermitted, + FmaContractionRefused, +} data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/container/oci/descriptor.dag b/dag/extdeps/container/oci/descriptor.dag index c08365303d6..50f092e99c5 100644 --- a/dag/extdeps/container/oci/descriptor.dag +++ b/dag/extdeps/container/oci/descriptor.dag @@ -1,5 +1,9 @@ module extdeps.container.oci.descriptor +import extdeps.container.oci.types { OciMediaType } +import std.types { Bool, ContentHash } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/container/oci/image_config.dag b/dag/extdeps/container/oci/image_config.dag index c4e63811eb4..47d38218ecd 100644 --- a/dag/extdeps/container/oci/image_config.dag +++ b/dag/extdeps/container/oci/image_config.dag @@ -1,5 +1,14 @@ module extdeps.container.oci.image_config +import extdeps.container.oci.types { + ContainerExposedPort, + ContainerPortProtocol, + Tcp, +} +import extdeps.toolchain.types { Architecture, Os } +import std.types { Bool, ContentHash, FilePath, NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/container/oci/linux.dag b/dag/extdeps/container/oci/linux.dag index 30c90a343af..e2a80f0ff76 100644 --- a/dag/extdeps/container/oci/linux.dag +++ b/dag/extdeps/container/oci/linux.dag @@ -1,5 +1,8 @@ module extdeps.container.oci.linux +import std.types { Bool, FilePath } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/container/oci/manifest.dag b/dag/extdeps/container/oci/manifest.dag index 140a6c8cc0f..a3d733c6f60 100644 --- a/dag/extdeps/container/oci/manifest.dag +++ b/dag/extdeps/container/oci/manifest.dag @@ -1,5 +1,21 @@ module extdeps.container.oci.manifest +import extdeps.container.oci.descriptor { + OciDescriptor, + DescriptorAccepted, + DescriptorRejected, + DescriptorRejectReason, + accept_descriptor, +} +import extdeps.container.oci.media_types { + media_type_oci_image_config_v1, + media_type_oci_image_manifest_v1, + oci_image_schema_version, +} +import extdeps.container.oci.types { OciMediaType } +import std.types { Bool } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/container/oci/media_types.dag b/dag/extdeps/container/oci/media_types.dag index afc044c0730..1c697c9684e 100644 --- a/dag/extdeps/container/oci/media_types.dag +++ b/dag/extdeps/container/oci/media_types.dag @@ -1,5 +1,15 @@ module extdeps.container.oci.media_types +import extdeps.container.oci.types { + OciMediaType, + OciImageManifestV1, + OciImageConfigV1, + OciImageLayerV1TarGzip, + OciImageIndexV1, + OciDescriptorV1, +} +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/container/oci/runtime_config.dag b/dag/extdeps/container/oci/runtime_config.dag index 1262d2a61a8..9e2a33e9a8b 100644 --- a/dag/extdeps/container/oci/runtime_config.dag +++ b/dag/extdeps/container/oci/runtime_config.dag @@ -1,5 +1,19 @@ module extdeps.container.oci.runtime_config +import extdeps.container.oci.linux { + LinuxPlatform, + accept_linux_platform, + LinuxPlatformAccepted, + LinuxPlatformRejected, +} +import extdeps.container.oci.types { + OciRuntimeVersion, + RuntimeMountKind, + RuntimeMountSource, +} +import std.types { Bool, FilePath, NonEmptyStr } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cpu.dag b/dag/extdeps/cpu.dag index 726625d7ef2..7f9ae6bce3c 100644 --- a/dag/extdeps/cpu.dag +++ b/dag/extdeps/cpu.dag @@ -1,5 +1,13 @@ module extdeps.cpu +import extdeps.cpu.types { CpuFacts } +import extdeps.toolchain.types { Architecture } +import extdeps.vendor { Vendor } +import extdeps.hardware { Hardware } +import std.measure { HardwareThreadCount, Hertz } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cpu/amd.dag b/dag/extdeps/cpu/amd.dag index a497f6601ea..3f3c9a5d04b 100644 --- a/dag/extdeps/cpu/amd.dag +++ b/dag/extdeps/cpu/amd.dag @@ -1,4 +1,26 @@ module extdeps.cpu.amd +import extdeps.cpu.types { + CacheGeometryCitation, + CpuFacts, + CpuL1CacheGeometry, + CpuL2CacheGeometry, + CpuL3CacheGeometry, + CpuModelCatalogRow, + CpuSocket, + PinGridArray, +} +import std.measure { + byte_size, + hardware_thread_count, + hertz, + watt, +} +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { + Https, + Uri, +} +import extdeps.vendor.amd { amd } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cpu/ampere.dag b/dag/extdeps/cpu/ampere.dag index 539ef009f8d..4ac86d44548 100644 --- a/dag/extdeps/cpu/ampere.dag +++ b/dag/extdeps/cpu/ampere.dag @@ -1,5 +1,20 @@ module extdeps.cpu.ampere +import extdeps.cpu.types { + CacheGeometryCitation, + CpuL1CacheGeometry, + CpuL2CacheGeometry, + CpuL3CacheGeometry, + CpuModelCatalogRow, + CpuSocket, + SocketPackage, +} +import extdeps.toolchain.types { Architecture } +import extdeps.vendor.ampere { ampere } +import std.measure { ByteSize, byte_size, hardware_thread_count, hertz, watt } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cpu/machine_shape.dag b/dag/extdeps/cpu/machine_shape.dag index 8a073c04e6e..f011e9219c4 100644 --- a/dag/extdeps/cpu/machine_shape.dag +++ b/dag/extdeps/cpu/machine_shape.dag @@ -1,5 +1,19 @@ module extdeps.cpu.machine_shape +import std.machine_shape { + DomainId, + LevelId, + MachineShape, + ExecutionDomain, + MemoryLevel, + MemoryShape, + MachineShapeConstruction, + MachineShapeOk, + execution_shape_independent_lanes, +} +import extdeps.cpu.types { CpuModelCatalogRow } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cpu/types.dag b/dag/extdeps/cpu/types.dag index d9812cc4262..55d53a7b8b7 100644 --- a/dag/extdeps/cpu/types.dag +++ b/dag/extdeps/cpu/types.dag @@ -1,5 +1,14 @@ module extdeps.cpu.types +import std.measure { ByteSize, HardwareThreadCount, Hertz, Watt } +import std.types { Int, NonEmptyStr, List } +import extdeps.vendor { Vendor } +import extdeps.hardware { Hardware } + +import extdeps.toolchain.types { Architecture } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cron/cron.dag b/dag/extdeps/cron/cron.dag index c9527e4dc38..addf1cfa1eb 100644 --- a/dag/extdeps/cron/cron.dag +++ b/dag/extdeps/cron/cron.dag @@ -1,5 +1,7 @@ module extdeps.cron +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/cron/mock_corpus.dag b/dag/extdeps/cron/mock_corpus.dag index 86ba8426e4e..2294bfada93 100644 --- a/dag/extdeps/cron/mock_corpus.dag +++ b/dag/extdeps/cron/mock_corpus.dag @@ -1,5 +1,6 @@ module extdeps.cron.mock_corpus +import std.hermetic_replay { PublishedMockCase } data cron_tab_mock_case_list: PublishedMockCase = PublishedMockCase { operation_key: "cron.Tab.List", diff --git a/dag/extdeps/ctrl/gunbc_pin.dag b/dag/extdeps/ctrl/gunbc_pin.dag index 14da3cc0db7..7df89c985a6 100644 --- a/dag/extdeps/ctrl/gunbc_pin.dag +++ b/dag/extdeps/ctrl/gunbc_pin.dag @@ -1,5 +1,8 @@ module extdeps.ctrl.gunbc_pin +import std.types { String, Bool } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/entropy/entropy.dag b/dag/extdeps/entropy/entropy.dag index ca3229c85dd..3b78f1ddc3a 100644 --- a/dag/extdeps/entropy/entropy.dag +++ b/dag/extdeps/entropy/entropy.dag @@ -1,5 +1,10 @@ module extdeps.entropy +import std.integer { UInt8 } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } +import std.disposition { Disposition, Scaffold, SingleAuthority, RealizationDispatch } +import std.decl_ref { DeclarationRef, WholeDeclaration } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/filesystem/filesystem_io.dag b/dag/extdeps/filesystem/filesystem_io.dag index 7ab0f1ee68e..e7039b1eddd 100644 --- a/dag/extdeps/filesystem/filesystem_io.dag +++ b/dag/extdeps/filesystem/filesystem_io.dag @@ -1,5 +1,7 @@ module extdeps.filesystem.filesystem_io +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/filesystem/mock_corpus.dag b/dag/extdeps/filesystem/mock_corpus.dag index 072850e6719..639c9ad3677 100644 --- a/dag/extdeps/filesystem/mock_corpus.dag +++ b/dag/extdeps/filesystem/mock_corpus.dag @@ -1,5 +1,6 @@ module extdeps.filesystem.mock_corpus +import std.hermetic_replay { PublishedMockCase } data filesystem_mock_case_write_committed: PublishedMockCase = PublishedMockCase { operation_key: "Filesystem.Write", diff --git a/dag/extdeps/filesystem/ntfs.dag b/dag/extdeps/filesystem/ntfs.dag index 7ceb9790e2f..8c7976a2b9a 100644 --- a/dag/extdeps/filesystem/ntfs.dag +++ b/dag/extdeps/filesystem/ntfs.dag @@ -1,5 +1,8 @@ module extdeps.filesystem.ntfs +import std.filesystem.types { EntryKind } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/filesystem/posix.dag b/dag/extdeps/filesystem/posix.dag index 6d5208f2f6c..55c92b7f380 100644 --- a/dag/extdeps/filesystem/posix.dag +++ b/dag/extdeps/filesystem/posix.dag @@ -1,5 +1,8 @@ module extdeps.filesystem.posix +import std.filesystem.types { EntryKind } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/formats/elf/encode.dag b/dag/extdeps/formats/elf/encode.dag index 0442d949bf9..f79ecb38bfb 100644 --- a/dag/extdeps/formats/elf/encode.dag +++ b/dag/extdeps/formats/elf/encode.dag @@ -1,5 +1,56 @@ module extdeps.formats.elf.encode +import extdeps.formats.elf.primitives { + ElfClass, + ElfClass32, + ElfClass64, + ElfClassNone, + ElfData2Lsb, + ElfData2Msb, + ElfDataEncoding, + ElfDataNone, + ElfFileType, + ElfMachine, + ElfSegmentType, + EtCore, + EtDyn, + EtExec, + EtNone, + EtRel, + EmNone, + EmX86_64, + PtLoad, + PtNull, + elf_class_32, + elf_class_64, + elf_class_none, + elf_data_2lsb, + elf_data_2msb, + elf_data_none, + elf64_ehdr_size, + elf64_phdr_size, + et_core, + et_dyn, + et_exec, + et_none, + et_rel, + em_none, + em_x86_64, + pt_load, + pt_null, +} +import extdeps.formats.elf.segments { Elf64Phdr } +import extdeps.formats.elf.types { + Elf64Ehdr, + ElfDecodeOutcome, + ElfDecoded, + ElfIdent, + byte_at_in_bounds, + decode_elf64_ehdr, +} +import std.types { Bool } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/formats/elf/hello_static_witness.dag b/dag/extdeps/formats/elf/hello_static_witness.dag index 19608dada7c..47c6f64d8cb 100644 --- a/dag/extdeps/formats/elf/hello_static_witness.dag +++ b/dag/extdeps/formats/elf/hello_static_witness.dag @@ -1,5 +1,27 @@ module extdeps.formats.elf.hello_static_witness - +import extdeps.formats.elf.primitives { + elf64_ehdr_size, + elf64_phdr_size, + linux_x86_64_elf_format, + pf_r, +} +import extdeps.formats.elf.encode { + encode_elf64_ehdr, + encode_elf64_phdr, + int_lists_equal, + witness_encode_decode_roundtrip_ehdr, +} +import extdeps.formats.elf.segments { + decode_elf64_phdr, + elf64_phdr_to_load_segment, +} +import extdeps.formats.elf.types { + decode_elf64_ehdr, + elf64_ehdr_entry_point, + elf_ident_has_valid_magic, +} +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/formats/elf/primitives.dag b/dag/extdeps/formats/elf/primitives.dag index 3147692a8cc..9eefe8944d2 100644 --- a/dag/extdeps/formats/elf/primitives.dag +++ b/dag/extdeps/formats/elf/primitives.dag @@ -1,5 +1,8 @@ module extdeps.formats.elf.primitives +import std.exec_format { ExecutableFormat, Elf } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/formats/elf/relocation.dag b/dag/extdeps/formats/elf/relocation.dag index e1a25027700..2c8ce852f36 100644 --- a/dag/extdeps/formats/elf/relocation.dag +++ b/dag/extdeps/formats/elf/relocation.dag @@ -1,5 +1,7 @@ module extdeps.formats.elf.relocation +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/formats/elf/sections.dag b/dag/extdeps/formats/elf/sections.dag index bd432921a33..9523a521e8f 100644 --- a/dag/extdeps/formats/elf/sections.dag +++ b/dag/extdeps/formats/elf/sections.dag @@ -1,5 +1,7 @@ module extdeps.formats.elf.sections +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/formats/elf/segments.dag b/dag/extdeps/formats/elf/segments.dag index bdb923dbf68..ce75fef5258 100644 --- a/dag/extdeps/formats/elf/segments.dag +++ b/dag/extdeps/formats/elf/segments.dag @@ -1,5 +1,22 @@ module extdeps.formats.elf.segments +import extdeps.formats.elf.primitives { + ElfSegmentType, + elf64_phdr_size, + pf_r, + pf_w, + pf_x, + pt_load, + pt_null, +} +import extdeps.formats.elf.types { + read_u32_le_in_bounds, + read_u64_le_in_bounds, +} +import std.exec_format { LoadSegment, SegmentPermission } +import std.types { Bool } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/formats/elf/types.dag b/dag/extdeps/formats/elf/types.dag index e870721c671..c68fb113d54 100644 --- a/dag/extdeps/formats/elf/types.dag +++ b/dag/extdeps/formats/elf/types.dag @@ -1,5 +1,34 @@ module extdeps.formats.elf.types +import extdeps.formats.elf.primitives { + ElfClass, + ElfClass64, + ElfDataEncoding, + ElfFileType, + ElfMachine, + elf_class_32, + elf_class_64, + elf_class_none, + elf_data_2lsb, + elf_data_2msb, + elf_data_none, + elf_mag0, + elf_mag1, + elf_mag2, + elf_mag3, + elf64_ehdr_size, + et_core, + et_dyn, + et_exec, + et_none, + et_rel, + em_none, + em_x86_64, +} +import std.exec_format { EntryPoint } +import std.types { Bool } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/git/git.dag b/dag/extdeps/git/git.dag index 1a434f8d417..d2a2629d9e6 100644 --- a/dag/extdeps/git/git.dag +++ b/dag/extdeps/git/git.dag @@ -1,5 +1,10 @@ module extdeps.git +import std.types { CommitSha, ContentHash, Email, FilePath, GitRef, NonEmptyStr, Timestamp } +import std.measure { Percent, percent } + +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/git/gitignore.dag b/dag/extdeps/git/gitignore.dag index 3c9ae80fa48..f839b306db6 100644 --- a/dag/extdeps/git/gitignore.dag +++ b/dag/extdeps/git/gitignore.dag @@ -1,5 +1,7 @@ module extdeps.gitignore +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/linux/edac.dag b/dag/extdeps/linux/edac.dag index 13efae4a95c..bbff328f8e8 100644 --- a/dag/extdeps/linux/edac.dag +++ b/dag/extdeps/linux/edac.dag @@ -1,5 +1,9 @@ module extdeps.linux.edac - +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { + Uri, + Https, +} data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/extdeps/ssh/session.dag b/dag/extdeps/ssh/session.dag index 80d6be4e37c..56a29f03cf3 100644 --- a/dag/extdeps/ssh/session.dag +++ b/dag/extdeps/ssh/session.dag @@ -1,5 +1,10 @@ module extdeps.ssh.session +import std.types { NonEmptyStr, FilePath, List, String, Bool, Int } +import extdeps.external_authority { ExternalAuthority } +import extdeps.uri { Uri, Https } + + data extdeps_external_authority_anchor: ExternalAuthority = ExternalAuthority { uri: Uri { diff --git a/dag/gunbc/accelerator_demo_eval.dag b/dag/gunbc/accelerator_demo_eval.dag index f63d7ebbab7..59baa988313 100644 --- a/dag/gunbc/accelerator_demo_eval.dag +++ b/dag/gunbc/accelerator_demo_eval.dag @@ -1,5 +1,17 @@ module gunbc.accelerator_demo_eval - +import std.types { + Int, + List, +} +import std.realization_width { int_max } +import gunbc.accelerator_demo_program { + AcceleratorDemoProgram, + PureElementwiseMap, + EffectfulElementwiseMap, + DataDependentGatherMap, + ElementwiseArrayOp, + pure_elementwise_ops_shape_recognizable, +} fn int_relu(x: Int) -> Int { int_max(a: 0, b: x) diff --git a/dag/gunbc/accelerator_demo_float_eval.dag b/dag/gunbc/accelerator_demo_float_eval.dag index 356a52e1a9b..7b91639e054 100644 --- a/dag/gunbc/accelerator_demo_float_eval.dag +++ b/dag/gunbc/accelerator_demo_float_eval.dag @@ -1,5 +1,14 @@ module gunbc.accelerator_demo_float_eval - +import std.float { Float } +import std.types { List } +import gunbc.accelerator_demo_program { + AcceleratorDemoProgram, + PureElementwiseMap, + EffectfulElementwiseMap, + DataDependentGatherMap, + ElementwiseArrayOp, + pure_elementwise_ops_shape_recognizable, +} fn float_relu(x: Float) -> Float { if x > 0.0 { diff --git a/dag/gunbc/accelerator_demo_gpu.dag b/dag/gunbc/accelerator_demo_gpu.dag index b268f82a639..0fad46d90bc 100644 --- a/dag/gunbc/accelerator_demo_gpu.dag +++ b/dag/gunbc/accelerator_demo_gpu.dag @@ -1,5 +1,40 @@ module gunbc.accelerator_demo_gpu - +import std.types { + String, + Bool, + Int, + NonEmptyStr, +} +import extdeps.communication.medium { + DecodeFidelity, + Lossless, + Lossy, +} +import std.numerical_contract { + NumericalContract, + IntegerExact, + FloatApproximate, + FmaContractionPermitted, + FmaContractionRefused, + integer_exact_contract, + float_contract, +} +import std.approximate_field { ToNearestEven } +import extdeps.gpu.types { + GpuModelCatalogRow, + GpuComputeCapability, +} +import extdeps.gpu.apple { apple_m5_gpu_catalog } +import extdeps.gpu.nvidia { nvidia_rtx_5090_catalog } +import extdeps.languages.gpu.wgsl.kernel { + wgsl_kernel_target_medium_name, + wgsl_relu_mul_add_int_kernel_source, + wgsl_relu_mul_add_float_kernel_source, +} +import std.measure { + hardware_thread_count_value, + bandwidth_count, +} fn wgsl_device_precision_fidelity(contract: NumericalContract) -> DecodeFidelity { match contract { diff --git a/dag/gunbc/accelerator_demo_plan.dag b/dag/gunbc/accelerator_demo_plan.dag index 1cc246bb525..29c9691d8c5 100644 --- a/dag/gunbc/accelerator_demo_plan.dag +++ b/dag/gunbc/accelerator_demo_plan.dag @@ -1,5 +1,60 @@ module gunbc.accelerator_demo_plan - +import std.types { + Bool, + String, + Int, + NonEmptyStr, +} +import std.measure { Nano } +import std.effects { ReadEffect } +import std.realization { + Placement, + LocalAccelerator, + LocalInProcess, + LocalFilesystem, + RemoteNetwork, + RealizedStep, + Materialization, + Recompute, +} +import std.realization_schedule { + RealizationPlan, + RealizationObjective, + Runnable, + RunnableKernelWorkload, + Schedule, + CostAccount, + cost_account_predicted_zero, +} +import std.numerical_contract { + NumericalContract, + IntegerExact, + FloatApproximate, + integer_exact_contract, + float_contract, + FmaContractionRefused, + FmaContractionPermitted, +} +import std.approximate_field { ToNearestEven } +import extdeps.communication.medium { + DecodeFidelity, + Lossless, + Lossy, +} +import extdeps.communication.numerical_fidelity { + LoweringAccepted, + LoweringRefused, + LoweringRefusalReason, + FmaContractionRefusedByContract, + UnsupportedNumericalDomain, + lowering_fidelity_verdict_for_contract, +} +import extdeps.gpu.types { AcceleratorFacts } +import extdeps.vendor.nvidia { nvidia } +import extdeps.languages.simd.kernel { + simd_kernel_target_medium_name, + witness_relu_mul_add_kernel_surface_shape, +} type ElementwiseFoldClass = PureElementwiseChain { op_count: Int } diff --git a/dag/gunbc/accelerator_demo_realize.dag b/dag/gunbc/accelerator_demo_realize.dag index 5eb31332d46..fe0f1161bce 100644 --- a/dag/gunbc/accelerator_demo_realize.dag +++ b/dag/gunbc/accelerator_demo_realize.dag @@ -1,5 +1,59 @@ module gunbc.accelerator_demo_realize - +import std.types { + Bool, + Int, + List, +} +import std.float { Float } +import std.numerical_contract { + FmaContractionPolicy, + NumericalContract, + FloatApproximate, + FmaContractionRefused, + FmaContractionPermitted, + float_contract, +} +import std.approximate_field { ToNearestEven } +import extdeps.communication.medium { + DecodeFidelity, + Lossless, + Lossy, +} +import gunbc.accelerator_demo_program { + AcceleratorDemoProgram, + PureElementwiseMap, + EffectfulElementwiseMap, + DataDependentGatherMap, + relu_mul_add_pure_program, + relu_mul_add_effectful_program, + relu_mul_add_gather_program, + relu_mul_add_incomplete_pure_program, + program_op_codes, +} +import gunbc.accelerator_demo_recognizer { + recognize_accelerator_program, + recognize_accelerator_program_with_contract, + witness_pure_program_structurally_recognized, + witness_effectful_program_structurally_refused, + witness_gather_program_structurally_refused, +} +import gunbc.accelerator_demo_eval { eval_accelerator_program } +import gunbc.accelerator_demo_float_eval { eval_accelerator_program_float } +import gunbc.accelerator_demo_plan { + AcceleratorRecognitionOutcome, + AcceleratorRefusalReason, + Recognized, + Refused, + NotElementwisePure, + CarriesEffects, + FmaContractionViolatesContract, + AcceleratorUnsupportedNumericalDomain, +} +import extdeps.languages.simd.kernel { + contiguous_loop_elementwise_kernel, + contiguous_loop_elementwise_float_kernel, + relu_mul_add_wire_op_codes, +} type DifferentialVerdict = BitExact diff --git a/dag/gunbc/accelerator_demo_recognizer.dag b/dag/gunbc/accelerator_demo_recognizer.dag index 172d49adfb7..d41c001bd26 100644 --- a/dag/gunbc/accelerator_demo_recognizer.dag +++ b/dag/gunbc/accelerator_demo_recognizer.dag @@ -1,5 +1,28 @@ module gunbc.accelerator_demo_recognizer - +import gunbc.accelerator_demo_program { + AcceleratorDemoProgram, + PureElementwiseMap, + EffectfulElementwiseMap, + DataDependentGatherMap, + pure_elementwise_ops_shape_recognizable, + relu_mul_add_pure_program, + relu_mul_add_effectful_program, + relu_mul_add_gather_program, +} +import gunbc.accelerator_demo_plan { + AcceleratorRecognitionOutcome, + Recognized, + Refused, + NotElementwisePure, + CarriesEffects, + FmaContractionViolatesContract, + AcceleratorUnsupportedNumericalDomain, + recognize_with_contract, +} +import std.numerical_contract { + NumericalContract, + integer_exact_contract, +} fn recognize_accelerator_program(program: AcceleratorDemoProgram) -> AcceleratorRecognitionOutcome { recognize_accelerator_program_with_contract( diff --git a/dag/gunbc/accelerator_demo_render.dag b/dag/gunbc/accelerator_demo_render.dag index 2a9aef47023..c30cffb2607 100644 --- a/dag/gunbc/accelerator_demo_render.dag +++ b/dag/gunbc/accelerator_demo_render.dag @@ -1,5 +1,60 @@ module gunbc.accelerator_demo_render - +import std.types { + String, + Int, + NonEmptyStr, + List, +} +import std.render { + kv_pair, + list_block, +} +import std.realization { + Placement, + LocalAccelerator, + LocalInProcess, + LocalFilesystem, + RemoteNetwork, +} +import std.numerical_contract { + NumericalContract, + IntegerExact, + FloatApproximate, + FmaContractionPermitted, + FmaContractionRefused, + float_contract, + integer_exact_contract, +} +import extdeps.communication.medium { + DecodeFidelity, + Lossless, + Lossy, +} +import gunbc.accelerator_demo_plan { + AcceleratorRecognitionOutcome, + AcceleratorRefusalReason, + Recognized, + Refused, + NotElementwisePure, + CarriesEffects, + FmaContractionViolatesContract, + AcceleratorUnsupportedNumericalDomain, + demo_plan_fused_op_count, + demo_target_label, +} +import gunbc.accelerator_demo_program { + AcceleratorDemoProgram, + PureElementwiseMap, + EffectfulElementwiseMap, + DataDependentGatherMap, + relu_mul_add_pure_program, + relu_mul_add_effectful_program, + elementwise_op_count, +} +import gunbc.accelerator_demo_recognizer { recognize_accelerator_program_with_contract } +import std.approximate_field { ToNearestEven } +import std.realization_schedule { RealizationPlan } +import std.measure { Nano } type AcceleratorDemoPlanView { target: String diff --git a/dag/gunbc/assimilate/bmc_bootstrap_provision.dag b/dag/gunbc/assimilate/bmc_bootstrap_provision.dag index dc2f9e93ac3..d4b6cc1f227 100644 --- a/dag/gunbc/assimilate/bmc_bootstrap_provision.dag +++ b/dag/gunbc/assimilate/bmc_bootstrap_provision.dag @@ -1,4 +1,41 @@ module gunbc.assimilate.bmc_bootstrap_provision +import std.cache_interface { Network } +import std.types { + NonEmptyStr, + Secret, + String, + List, + Map, + Bool, +} +import extdeps.cloud.gcp.gcp { + GcpProjectId, + ServiceAccountEmail, + GcpService, + gcp_service_api_id, +} +import extdeps.cloud.gcp.iam { + GcpBinding, + role_secretmanager_secret_accessor, + role_secretmanager_secret_version_adder, +} +import gunbc.assimilate.bmc_token_federation { + bmc_secrets_project_id, + bmc_srv3_secret_name, + bmc_assimilator_sa_member, + bmc_assimilator_account_id, + bmc_assimilator_display_name, + bmc_wif_pool_id, + bmc_wif_pool_display_name, + bmc_wif_provider_id, + bmc_wif_issuer_uri, + bmc_wif_attribute_mapping, + bmc_wif_attribute_condition, +} + +import extdeps.cloud.gcp.serviceusage +import extdeps.cloud.gcp.iam_admin +import extdeps.cloud.gcp.secret_manager data bmc_assimilate_service_deps: List = [ diff --git a/dag/gunbc/assimilate/bmc_wif_canary_bootstrap.dag b/dag/gunbc/assimilate/bmc_wif_canary_bootstrap.dag index 47f499c757b..454b85f08fa 100644 --- a/dag/gunbc/assimilate/bmc_wif_canary_bootstrap.dag +++ b/dag/gunbc/assimilate/bmc_wif_canary_bootstrap.dag @@ -1,4 +1,33 @@ module gunbc.assimilate.bmc_wif_canary_bootstrap +import std.cache_interface { Network } +import std.types { + String, + List, +} +import extdeps.cloud.gcp.gcp { + GcpService, + gcp_service_api_id, + ServiceAccountEmail, +} +import gunbc.assimilate.bmc_token_federation { + bmc_secrets_project_id, + bmc_assimilator_account_id, + bmc_assimilator_display_name, + bmc_wif_pool_id, + bmc_wif_pool_display_name, + bmc_wif_provider_id, + bmc_wif_issuer_uri, + bmc_wif_attribute_mapping, + bmc_wif_attribute_condition, +} +import gunbc.assimilate.bmc_wif_delegation_chain { + wif_canary_secret_name, + bmc_wif_bootstrap_bindings, +} + +import extdeps.cloud.gcp.serviceusage +import extdeps.cloud.gcp.iam_admin +import extdeps.cloud.gcp.secret_manager data bmc_wif_bootstrap_service_deps: List = [ diff --git a/dag/gunbc/auth/credentials.dag b/dag/gunbc/auth/credentials.dag index d101c518585..89e70496b63 100644 --- a/dag/gunbc/auth/credentials.dag +++ b/dag/gunbc/auth/credentials.dag @@ -1,4 +1,12 @@ module gunbc.auth.credentials +import std.cache_interface { Network } +import std.types { + FilePath, + NonEmptyStr, +} + +import extdeps.cloud.gcp.gcp +import extdeps.cloud.gcp.secret_manager pattern gcp_secret_credential( diff --git a/dag/gunbc/auth/optional_impersonation.dag b/dag/gunbc/auth/optional_impersonation.dag index d1d5a2de56c..84e2fe10150 100644 --- a/dag/gunbc/auth/optional_impersonation.dag +++ b/dag/gunbc/auth/optional_impersonation.dag @@ -1,5 +1,11 @@ module gunbc.auth.optional_impersonation +import std.types { + Secret, + Int, +} +import extdeps.cloud.gcp.gcp { ServiceAccountEmail } +import extdeps.cloud.gcp.iam pattern optional_impersonation( access_token: Secret, diff --git a/dag/gunbc/auth/patterns.dag b/dag/gunbc/auth/patterns.dag index a7d531f096c..7c1f78f5a93 100644 --- a/dag/gunbc/auth/patterns.dag +++ b/dag/gunbc/auth/patterns.dag @@ -1,4 +1,27 @@ module gunbc.auth.patterns +import v2.extdeps.file_system { Filesystem } +import std.cache_interface { Network } +import std.types { + AccessToken, + AuthScheme, + Bearer, + NonEmptyStr, +} +import extdeps.cloud.gcp.gcp { + GcpProjectId, + ServiceAccountEmail, +} +import extdeps.cloud.gcp.sts { MetadataRuntime } +import extdeps.github.actions { GitHubActionsRuntime } +import extdeps.runtime.local { LocalDevRuntime } +import gunbc.auth.optional_impersonation { optional_impersonation } + +import extdeps.cloud.gcp.secret_manager +import extdeps.cloud.gcp.iam +import extdeps.cloud.gcp.sts + + +import extdeps.shell type AuthRuntime diff --git a/dag/gunbc/bootstrap.dag b/dag/gunbc/bootstrap.dag index 824204ff472..da7fcc54555 100644 --- a/dag/gunbc/bootstrap.dag +++ b/dag/gunbc/bootstrap.dag @@ -1,5 +1,9 @@ module gunbc.bootstrap - +import std.types { + ContentHash, + FilePath, + NonEmptyStr, +} type CompilerStage = Tokenize diff --git a/dag/gunbc/ci_budget_tree.dag b/dag/gunbc/ci_budget_tree.dag index 3b43441dcb1..25c251d4d6d 100644 --- a/dag/gunbc/ci_budget_tree.dag +++ b/dag/gunbc/ci_budget_tree.dag @@ -1,5 +1,61 @@ module gunbc.ci_budget_tree - +import std.measure { + ByteSize, + byte_size, + Memory, + One, +} +import std.types { + Int, + List, + String, + Bool, +} +import std.disposition { + Disposition, + Terminal, +} +import std.realization_width { byte_size_saturating_sub } +import extdeps.accounting.budget { + Appropriation, + LineItem, +} +import product.budget_tree { + BudgetNode, + BudgetClaim, + Guaranteed, + BudgetChild, + budget_child_named, +} +import gunbc.ci_fleet { + ComputeOffer, + srv1_offer, + srv2_offer, + srv3_offer, +} +import gunbc.fleet_intent { compute_host_ram_bytes_total } +import gunbc.ci_runner_target { + FleetSelfHosted, + ci_runner_target_ram_speed_budget, + selected_ci_runner_target, +} +import gunbc.ci_floor_measurement { + HostFixedOverhead, + HostFixedOverheadMeasured, + HostFixedOverheadUnmeasured, + gunbc_ci_host_fixed_overhead, + gunbc_ci_runner_cgroup_memory_cap, + gunbc_ci_runner_slot_memory_max_live, + gunbc_ci_dashboard_session_container_cap, + gunbc_ci_session_reservation_mode, +} +import gunbc.ci_runner_placement { + SessionSliceResolution, + SessionSliceResolved, + SessionSliceUnresolved, + resolve_session_slice, +} +import gunbc.fleet_host_budget { gunbc_fleet_oomd_evidence } data gunbc_ci_budget_tree_deconfliction_disposition: Disposition = std.disposition.Terminal { reason: "DESIGN §3 deliberate carrier split: this BudgetNode governs INTER-run co-residence (host_ram partitioned as overhead + sessions_slice + runner_slice, conserving by construction via byte_size_saturating_sub). srv1_floor_memory_budget returns gunbc_ci_runner_slot_ram_speed_ceiling (min of live MemoryHigh 15GiB and live MemoryMax 16GiB per the applied 2026-07-11 allocation ruling; see srv1_floor_memory_budget_live_note - within-run width packs to the throttle line, memory.max stays the kill authority). gunbc_ci_dashboard_session_container_cap (31.27 GiB) is inter-run session pool only. Do NOT conflate. See gunbc_ci_footprint_granularity_disposition." } diff --git a/dag/gunbc/ci_input_envelope.dag b/dag/gunbc/ci_input_envelope.dag index a633c9b4690..7e3324fdde0 100644 --- a/dag/gunbc/ci_input_envelope.dag +++ b/dag/gunbc/ci_input_envelope.dag @@ -1,5 +1,20 @@ module gunbc.ci_input_envelope - +import std.measure { + Measure, + Count, + One, +} +import std.types { List } +import std.nat { Nat } +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} type InputSizeAxis = WitnessCount diff --git a/dag/gunbc/ci_materialization_gate.dag b/dag/gunbc/ci_materialization_gate.dag index c262e6d2454..785725b681b 100644 --- a/dag/gunbc/ci_materialization_gate.dag +++ b/dag/gunbc/ci_materialization_gate.dag @@ -1,5 +1,54 @@ module gunbc.ci_materialization_gate - +import std.types { + Bool, + Int, + List, + String, +} +import std.materialization_ladder { + FrameDemand, + CacheProvider, + LadderVerdict, + AuthoredDuplication, + DeadComputation, + AcceptedEffectIsTheUse, + Discharged, + RefusedNoProvider, + RefusedScopeTooNarrow, + RefusedExistenceKeyed, + RefusedUnmodeledWorldRead, + ExemptFreshEffect, + AcceptedBelowCostFloor, + AcceptedSingleRecompute, + RefusedNatureConflict, + materialization_ladder, + materialization_ladder_holds, + verdict_is_discharged_by, + verdict_is_refused_no_provider, + verdict_is_accepted_single_recompute, + no_cache_providers, +} +import gunbc.ci_materialization { + ci_cache_providers, + ci_cost_floor_exempt_step_names, + ci_sccache_provider_id, + workflow_run_demands, + workflow_scripts_named, + step_run_script, + workflow_uses_steps_count, + workflow_run_steps_count, +} +import gunbc.ci_workflow { + ci_workflow, + ci_floor_peak_pre_step, + ci_floor_peak_post_step, +} +import gunbc.ci_spec { + DeployStage, + gunbc_ci_deploy_stages, + gunbc_ci_deploy_invoke, +} +import v2.workflow.ci_release_build_emit { ci_release_build_script } data ci_materialization_gate_note: String = "The live binding: the ladder run over the ACTUAL emitted workflow (gunbc.ci_workflow data row), never a fixture copy of it. Demands, exemption identities, and fresh-effect scripts are all resolved against the same authority the ci.yml is emitted from, so a workflow edit that introduces cross-job duplication without a covering provider reds the enrolled witness in the same CI run that would have paid the duplication. Post-fold reality (ci_regen job folded into the ci job 2026-07-11): the workflow now has a SINGLE building job, so the release build is one demand -> AcceptedSingleRecompute (state 5: a single undeclared demand needs no provider, a cache there is dead weight), and the ladder holds WITH AND WITHOUT the sccache provider. The cross-job duplication the ladder refutes is now carried as the discriminating RED control by the synthetic placement_grain witness (two independently-building jobs -> AuthoredDuplication/RefusedNoProvider), which the live witness's demand==1 / discharged==0 pins guard against reintroducing. Fresh effects: the floor cgroup-peak measurement scripts (a memory.peak read is a new fact each run, never memoizable — the rust_tests cgroup-peak measurement was the prior subject; it retired with the rust_tests job 2026-07-11, and the ci-job floor peak pre/post reads are the same measurement category) and every deploy stage script (a deploy is the effect being the use); all resolved by projection, not copied strings." diff --git a/dag/gunbc/ci_oom_reclassify.dag b/dag/gunbc/ci_oom_reclassify.dag index b7a5c927acd..4d5ad0760ae 100644 --- a/dag/gunbc/ci_oom_reclassify.dag +++ b/dag/gunbc/ci_oom_reclassify.dag @@ -1,5 +1,14 @@ module gunbc.ci_oom_reclassify - +import gunbc.ci_failure_class { + FloorOutcome, + NoFailure, + FloorFailed, + FloorFailureClass, + Infra, + Structural, + InfraSignature, + ClusteredOutOfMemoryKill, +} type OomKillSource = CgroupMemoryEvents diff --git a/dag/gunbc/cli_run_floor_lens_oracle_scaffold.dag b/dag/gunbc/cli_run_floor_lens_oracle_scaffold.dag index 561ab87ef58..956f92bec25 100644 --- a/dag/gunbc/cli_run_floor_lens_oracle_scaffold.dag +++ b/dag/gunbc/cli_run_floor_lens_oracle_scaffold.dag @@ -1,5 +1,14 @@ module gunbc.cli_run_floor_lens_oracle_scaffold - +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, + Terminal, +} data cli_run_floor_lens_legacy_graph_oracle_scaffold: Disposition = Scaffold { dissolves_to: SingleAuthority, diff --git a/dag/gunbc/cli_run_workspace_root_scaffold.dag b/dag/gunbc/cli_run_workspace_root_scaffold.dag index f03ef9aa3b4..6753ddacf24 100644 --- a/dag/gunbc/cli_run_workspace_root_scaffold.dag +++ b/dag/gunbc/cli_run_workspace_root_scaffold.dag @@ -1,5 +1,13 @@ module gunbc.cli_run_workspace_root_scaffold - +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} data cli_run_workspace_root_discovery_scaffold: Disposition = Scaffold { dissolves_to: SingleAuthority, diff --git a/dag/gunbc/code_change_workflow.dag b/dag/gunbc/code_change_workflow.dag index 4a2ac07c488..d47bca18029 100644 --- a/dag/gunbc/code_change_workflow.dag +++ b/dag/gunbc/code_change_workflow.dag @@ -1,4 +1,21 @@ module gunbc.code_change_workflow +import gunbc.process_algebra { ProcessNodeId } +import gunbc.pr_digests { + MergeReadinessVerdict, + Ready, + NotReady, +} +import gunbc.review_verdict { MergeReadinessTally } +import extdeps.github.pulls { + PullRequest, + Open, + Closed, +} +import std.types { + CommitSha, + NonEmptyStr, + Timestamp, +} type CodeChangeActiveStage = ChangeOpen diff --git a/dag/gunbc/deployed_intent_v0.dag b/dag/gunbc/deployed_intent_v0.dag index ca2423f50c2..6625093ed95 100644 --- a/dag/gunbc/deployed_intent_v0.dag +++ b/dag/gunbc/deployed_intent_v0.dag @@ -1,5 +1,30 @@ module gunbc.deployed_intent_v0 - +import std.types { + String, + NonEmptyStr, + Bool, +} +import std.disposition { + Disposition, + Terminal, +} +import product.placement_supply { HostIdentity } +import gunbc.fleet_intent { + ComputeHost, + srv1_host, + srv2_host, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import gunbc.host_identity_observation { + HostIdentityObservation, + HostIdentityObservationRow, + gunbc_srv1_host_identity_observation_fixture_row, + gunbc_srv2_host_identity_observation_fixture_row, + host_identity_observation_typed, +} type DeployedIntentV0 { fleet_slot: HostIdentity diff --git a/dag/gunbc/design_argument.dag b/dag/gunbc/design_argument.dag index 736b403c78a..47306f0c7ea 100644 --- a/dag/gunbc/design_argument.dag +++ b/dag/gunbc/design_argument.dag @@ -1,5 +1,11 @@ module gunbc.design_argument - +import std.syllogism { + Axiom, + LogicalAxiom, + NonLogicalAxiom, + Proposition, + Argument, +} data design_axioms: List = [ Axiom { diff --git a/dag/gunbc/digest_render.dag b/dag/gunbc/digest_render.dag index 5848ebb9604..25a3130401f 100644 --- a/dag/gunbc/digest_render.dag +++ b/dag/gunbc/digest_render.dag @@ -1,5 +1,16 @@ module gunbc.digest_render - +import extdeps.github.pulls { + PullRequest, + PullReview, + PullRequestState, + ReviewState, + Open, +} +import std.render { + kv_pair, + list_block, +} +import std.types { NonEmptyStr } type PullRequestDigestSubject { number: Int diff --git a/dag/gunbc/file_access.dag b/dag/gunbc/file_access.dag index 293e27b981f..0d23acdaf59 100644 --- a/dag/gunbc/file_access.dag +++ b/dag/gunbc/file_access.dag @@ -1,5 +1,21 @@ module gunbc.file_access - +import std.types { + String, + NonEmptyStr, + Bool, +} +import std.upsert_decision { + ObservationVerdict, + Converged, + Absent, + Drifted, + Inaccessible, + UpsertDecision, + UpsertClassification, + Noop, + Apply, + Refuse, +} type FileTreeScope { root_path: NonEmptyStr diff --git a/dag/gunbc/fleet_converge_cli.dag b/dag/gunbc/fleet_converge_cli.dag index 92b49d925dc..956cfb439bb 100644 --- a/dag/gunbc/fleet_converge_cli.dag +++ b/dag/gunbc/fleet_converge_cli.dag @@ -1,5 +1,58 @@ module gunbc.fleet_converge_cli - +import std.types { + Int, + List, + String, +} +import std.disposition { + Disposition, + Terminal, +} +import product.placement_supply { HostIdentity } +import gunbc.host_converge { + ConvergePolicyDerived, + ConvergePolicyUnsound, + ConvergeVerdict, + HostConverge, + VerdictConverged, + converge_verdict_label, + find_by_identity, + fleet_converge_policy, +} +import gunbc.host_effect { + ConvergePlan, + HostEffect, + HostEffectIntent, + OsInstallActuatorToolchainEnsure, + ProvisionBuildCache, + RedfishAction, + SetHostnameCas, + Srv3BmcwebSessionLogin, + Srv3BmcwebTokenExtract, + Srv3BootOnceReadBackSleep, + Srv3InstallMediaFetch, + Srv3NbdProxyServe, + Srv3ReceiptEmit, + Srv3SeededInstallMediaRemaster, + Srv3SeededInstallMediaToolchainEnsure, +} +import gunbc.fleet_converge_apply { converge_apply_for_host } +import gunbc.fleet_intent_network { operator_host_srv1 } +import gunbc.host_converge_slice1 { + HostConvergeSlice1Converged, + HostConvergeSlice1Refused, + host_converge_slice1_converge_loop, + host_converge_slice1_receipt_is_valid, +} +import std.realization_reconcile { + Converged, + NotConverged, +} +import gunbc.host_runner_memory_cap_verify { + RunnerMemoryCapVerifyRunResult, + runner_memory_cap_verify_run, +} +import gunbc.host_runner_memory_provision { runner_memory_host_converge } data gunbc_converge_cli_stage0_receiver_disposition: Disposition = Terminal { reason: "stage0's `gunbc converge --host ` argv dispatch (src/v1/stage0/src/cli_run.rs::handle_converge) is the CLI transport handler for this .dag interface (DESIGN §3 transport-is-a-handler): argv parse -> resolve_entry_graph_shared -> run_in_context_with_args(converge_cli_output) -> stdout/exit-code projection, nothing else. All interpretation, the byte-locked receipt grammar, and typed refusal causes are modeled here (gunbc.fleet_converge_cli) and in gunbc.host_converge/gunbc.fleet_converge_apply; the Rust side carries no converge logic and is not scaffold pending dissolution." diff --git a/dag/gunbc/fleet_show_effective_read.dag b/dag/gunbc/fleet_show_effective_read.dag index 7d1c55a01ea..c20fa0baab8 100644 --- a/dag/gunbc/fleet_show_effective_read.dag +++ b/dag/gunbc/fleet_show_effective_read.dag @@ -1,5 +1,90 @@ module gunbc.fleet_show_effective_read - +import std.types { + Bool, + Int, + List, + NonEmptyStr, + String, +} +import std.measure { + ByteSize, + Percent, + byte_size_count, + percent, + percent_count, +} +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, + Terminal, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.realization_reconcile { + Converged, + NotConverged, + ReadAbsent, + ReadObserved, + Reconciliation, + ShowEffectiveRead, +} +import product.placement_supply { HostIdentity } +import extdeps.systemd { + MemoryLimitAbsent, + MemoryLimitBytes, + MemoryLimitUnbounded, + SystemdCgroupMemoryLimit, + parse_systemd_memory_limit_show, + systemd_memory_high_property, + systemd_memory_max_property, + systemd_memory_swap_max_property, +} +import extdeps.systemd.oomd { parse_managed_oom_pressure_limit_show } +import gunbc.fleet_intent { + srv1_host, + srv2_host, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import gunbc.host_converge { + Absent, + ConvergeTarget, + ConvergeVerdict, + Drifted, + VerdictConverged, +} +import gunbc.host_effect { + HostEffectEvidence, + HostEffectIntent, + HostEffectTransport, + NodeControlPlane, + host_effect_read_evidence, +} +import gunbc.host_effect_realize { host_effect_apply } +import gunbc.host_identity_adopt { + srv1_host_identity_ssh_transport, + srv2_host_identity_ssh_transport, +} +import gunbc.ci_floor_measurement { + CapEffective, + CapUnbounded, + RunnerSliceCapEffectiveness, +} +import gunbc.runner_unit_live_read { + RunnerUnitLiveReadRow, + RunnerUnitMemoryLiveRead, + converge_target_live_verdict, + gunbc_srv1_runner_unit_live_read_fixture, + memory_limit_converge_verdict, + memory_limit_to_cap_effectiveness, + runner_unit_live_read_typed, +} +import gunbc.systemctl_show_read { systemctl_show_property_read } type RunnerSliceCapLiveReadRow { slice_unit: NonEmptyStr diff --git a/dag/gunbc/floor_materialization.dag b/dag/gunbc/floor_materialization.dag index c46f4484802..6babf05b124 100644 --- a/dag/gunbc/floor_materialization.dag +++ b/dag/gunbc/floor_materialization.dag @@ -1,4 +1,36 @@ module gunbc.floor_materialization +import std.types { + Bool, + Int, + List, + String, +} +import std.realization_schedule { ScheduleWitnessEntry } +import gunbc.ci_gate { + Gate, + EmitHostGate, + ExtdepsExternalAuthorityGate, + DagCompileCleanGate, + GeneratedArtifactDriftGate, + SourceRootIngestGate, + RegenVerifyGate, + SelfHostReadsRealBytesGate, + SelfHostStalenessGate, +} +import std.materialization_ladder { + Frame, + SharedStateFrame, + CacheProvider, + ReferenceTier, + CoversIdentities, + scope_exit_eviction, + provider_row, + ValueUsage, + ValueConsumerEdge, + ReadAccess, + ValueMaterialization, + value_materialization, +} data floor_materialization_note: String = "P1 — the in-process INDEX-BUILD share, declared. Every floor consumer (spec gates + witness entries + the floor-runner/entry-selection prelude) resolves against ONE shared MultiEntryIndex — union-resolve S1 (#6234) materializes the parse + typecheck index once per (thread, source_roots) via process_shared_index (cli_run.rs:1737); each consumer then assembles its own view over that shared index. N consumers demanding one index-build with no Share is the ladder's rule-1 AuthoredDuplication at a SharedStateFrame (one claim_executor process); S1 already did the rule-1 REWIRE (the index is readonly, so the plural reads are legal at the VALUE tier). This module DECLARES that correct-but-undeclared share as a ReferenceTier provider row so it is ladder-visible and a regression (a consumer that builds a private index instead of reading the share) is countable, not re-discovered per lens/gate." diff --git a/dag/gunbc/gha_yaml_fold_pilot.dag b/dag/gunbc/gha_yaml_fold_pilot.dag index b9548c3425a..83d2c9d09e6 100644 --- a/dag/gunbc/gha_yaml_fold_pilot.dag +++ b/dag/gunbc/gha_yaml_fold_pilot.dag @@ -1,5 +1,11 @@ module gunbc.gha_yaml_fold_pilot - +import extdeps.github.actions { + ActionRef, + Job, + RunStep, + SelfHosted, + UsesStep, +} data gha_fold_pilot_job: extdeps.github.actions.Job = extdeps.github.actions.Job { id: "pilot", diff --git a/dag/gunbc/hand_lens_host_bridge_scaffold_index.dag b/dag/gunbc/hand_lens_host_bridge_scaffold_index.dag index e1f966e01a4..8c16f1976ff 100644 --- a/dag/gunbc/hand_lens_host_bridge_scaffold_index.dag +++ b/dag/gunbc/hand_lens_host_bridge_scaffold_index.dag @@ -1,5 +1,13 @@ module gunbc.hand_lens_host_bridge_scaffold_index - +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} data transport_script_position_host_bridge_dissolution_trigger: Disposition = Scaffold { dissolves_to: SingleAuthority, diff --git a/dag/gunbc/hand_lens_host_bridge_scaffold_watchdog.dag b/dag/gunbc/hand_lens_host_bridge_scaffold_watchdog.dag index d76deeafff6..776711c833e 100644 --- a/dag/gunbc/hand_lens_host_bridge_scaffold_watchdog.dag +++ b/dag/gunbc/hand_lens_host_bridge_scaffold_watchdog.dag @@ -1,5 +1,18 @@ module gunbc.hand_lens_host_bridge_scaffold_watchdog - +import gunbc.hand_lens_host_bridge_scaffold_index { + transport_script_position_host_bridge_dissolution_trigger, + extdeps_external_authority_host_bridge_dissolution_trigger, +} +import std.types { + List, + String, + Bool, +} +import std.disposition { + Disposition, + Scaffold, + Terminal, +} type HostBridgeScaffoldRow { lens_module: String diff --git a/dag/gunbc/host_converge_delta.dag b/dag/gunbc/host_converge_delta.dag index bc767f6e880..85e6a93fb9d 100644 --- a/dag/gunbc/host_converge_delta.dag +++ b/dag/gunbc/host_converge_delta.dag @@ -1,5 +1,36 @@ module gunbc.host_converge_delta - +import std.types { + String, + List, + Bool, +} +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.change { + KeyedRow, + KeyedPatch, + KeyedThreeWayPatch, + KeyedLeafVerdict, + keyed_two_way_diff, + keyed_three_way_fold, + keyed_apply_patch, + keyed_invert_patch, + keyed_patch_hunk_count, + keyed_three_way_entry_count, +} +import gunbc.host_converge { + ConvergeKnob, + ConvergeSlice, + ConvergeTarget, + HostConverge, +} data gunbc_converge_target_byte_normalization_marker: Disposition = Scaffold { dissolves_to: SingleAuthority, diff --git a/dag/gunbc/host_identity_access.dag b/dag/gunbc/host_identity_access.dag index 5daa27542a7..ad38cb6c8ee 100644 --- a/dag/gunbc/host_identity_access.dag +++ b/dag/gunbc/host_identity_access.dag @@ -1,5 +1,31 @@ module gunbc.host_identity_access - +import std.types { + List, + NonEmptyStr, +} +import gunbc.fleet_intent { + ComputeHost, + srv1_host, + srv2_host, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import gunbc.fleet_posix_accounts { + FleetAccountOperator, + fleet_posix_principal, + grounded_posix_principal_name, + fleet_hostnamectl_command_path, +} +import gunbc.host_effect { + HostEffectTransport, + SshShell, +} +import gunbc.ci_deploy_access { + DeployAccess, + grounded_principal_privileged_commands, +} data host_identity_hostnamectl_path: NonEmptyStr = fleet_hostnamectl_command_path diff --git a/dag/gunbc/host_identity_adopt.dag b/dag/gunbc/host_identity_adopt.dag index 76872b9c463..617bd7916c6 100644 --- a/dag/gunbc/host_identity_adopt.dag +++ b/dag/gunbc/host_identity_adopt.dag @@ -1,4 +1,61 @@ module gunbc.host_identity_adopt +import std.types { + String, + NonEmptyStr, + Bool, + ContentHash, +} +import std.disposition { + Disposition, + Terminal, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import std.content_hash { content_hash_atom } +import product.placement_supply { HostIdentity } +import gunbc.fleet_intent { + ComputeHost, + srv1_host, + srv2_host, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import gunbc.host_effect { + NodeControlPlane, + HostEffectTransport, + SshShell, + EmitArtifactThenThinRun, +} +import gunbc.host_identity_knob { + HostIdentityKnobKey, + host_identity_knob_key, +} +import gunbc.host_identity_observation { + HostIdentityObservation, + host_identity_observation_apply, + host_identity_observation_from_apply, + host_identity_observation_nonempty, +} +import gunbc.deployed_intent_v0 { + DeployedIntentV0, + deployed_intent_v0_adopt_observed_base, + deployed_intent_observed_differs_from_fleet_slot, + deployed_intent_observed_short_hostname, +} +import std.realization_reconcile { reconciliation_converged } + +import extdeps.shell type HostIdentityAdoptReceipt { diff --git a/dag/gunbc/host_identity_assimilation.dag b/dag/gunbc/host_identity_assimilation.dag index 44ce255ec34..06a29682e5f 100644 --- a/dag/gunbc/host_identity_assimilation.dag +++ b/dag/gunbc/host_identity_assimilation.dag @@ -1,4 +1,87 @@ module gunbc.host_identity_assimilation +import std.types { + String, + NonEmptyStr, + Bool, + ContentHash, +} +import std.disposition { + Disposition, + Terminal, +} +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import std.content_hash { content_hash_atom } +import extdeps.dns.domain_name { DnsLabel } +import product.placement_supply { HostIdentity } +import gunbc.fleet_intent { + ComputeHost, + srv1_host, + srv2_host, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import gunbc.host_effect { + NodeControlPlane, + HostEffectTransport, +} +import gunbc.host_identity_knob { + HostIdentityKnobKey, + HostIdentityLeafVerdict, + host_identity_knob_key, +} +import std.change { + KeyedLeafVerdictFold, + keyed_leaf_verdict_fold, +} +import gunbc.host_identity_observation { + HostIdentityObservation, + host_identity_observation_nonempty, +} +import gunbc.host_identity_adopt { + host_identity_observed_probed_at, + host_identity_transport_label, + host_identity_adopt_model_hash, + srv1_host_identity_ssh_transport, + srv2_host_identity_ssh_transport, +} +import gunbc.deployed_intent_v0 { + DeployedIntentV0, + deployed_intent_observed_short_hostname, + deployed_intent_observed_differs_from_fleet_slot, + gunbc_srv1_deployed_intent_v0_persisted, + gunbc_srv2_deployed_intent_v0_persisted, +} +import gunbc.deployed_intent_v1 { + DeployedIntentV1, + gunbc_srv1_deployed_intent_v1, + gunbc_srv2_deployed_intent_v1, +} +import gunbc.host_identity_converge { + host_identity_precondition_verdict, + host_identity_precondition_is_noop, + host_identity_precondition_is_conflict, + host_identity_plan_from_verdict, + host_identity_apply_gated, + host_identity_observation_live, + host_identity_read_back_matches, + host_identity_apply_converged, +} +import gunbc.host_identity_access { + host_identity_srv1_access, + host_identity_srv2_access, +} +import gunbc.ci_deploy_access { + DeployAccess, + DeployAccessActor, +} + +import extdeps.shell type HostIdentityAssimilationTarget { diff --git a/dag/gunbc/host_identity_knob.dag b/dag/gunbc/host_identity_knob.dag index 1b22e3fba15..51f95dabaa5 100644 --- a/dag/gunbc/host_identity_knob.dag +++ b/dag/gunbc/host_identity_knob.dag @@ -1,5 +1,13 @@ module gunbc.host_identity_knob - +import std.types { + String, + Bool, +} +import std.change { + KeyedLeafVerdict, + keyed_three_way_leaf, +} +import product.placement_supply { HostIdentity } type HostIdentityHostnameField = HostnameShort diff --git a/dag/gunbc/host_identity_observation.dag b/dag/gunbc/host_identity_observation.dag index 4d2dd15b7f5..730871b2522 100644 --- a/dag/gunbc/host_identity_observation.dag +++ b/dag/gunbc/host_identity_observation.dag @@ -1,5 +1,34 @@ module gunbc.host_identity_observation - +import std.types { + String, + NonEmptyStr, + Bool, +} +import std.disposition { + Disposition, + Terminal, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import gunbc.host_effect { + NodeControlPlane, + host_effect_read_evidence, + HostEffectTransport, + HostEffectIntent, + HostEffectEvidence, + ConvergePlanApplied, +} +import gunbc.host_effect_realize { host_effect_apply } +import std.realization_reconcile { + Reconciliation, + Converged, + NotConverged, + reconciliation_converged, +} type HostIdentityObservationRow { short_hostname_raw: String diff --git a/dag/gunbc/host_standup.dag b/dag/gunbc/host_standup.dag index 105aabfdc46..098de35874d 100644 --- a/dag/gunbc/host_standup.dag +++ b/dag/gunbc/host_standup.dag @@ -1,5 +1,52 @@ module gunbc.host_standup - +import std.types { + List, + String, + NonEmptyStr, + Bool, + Int, +} +import std.measure { millisecond } +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.effects { IdempotencyEvidence } +import gunbc.host_effect { + host_effect_identity_evidence, + host_effect_converge_loop_evidence, +} +import gunbc.bmc_onboarding { + CredentialsRotated, + bmc_credential_probe_to_phase, + BmcCredentialProbeResult, + FactoryCredentialActive, + RotatedCredentialActive, +} +import gunbc.os_install_mechanism { + NbdProxyVirtualMediaInstall, + srv3_install_mechanism, +} +import gunbc.host_converge { + fleet_converge_policy, + ConvergePolicy, +} +import gunbc.fleet_intent_network { operator_host_srv3 } +import product.placement_supply { HostIdentity } +import std.upsert_decision { + ObservationVerdict, + Converged, + Absent, +} +import gunbc.host_standup_assimilation_deduction { + srv3_pre_install_actuation_verdict, + deduce_os_install_actuated_satisfied, +} type HostStandupPrefixPhase = BmcCredentialConverge diff --git a/dag/gunbc/host_standup_assimilation_deduction.dag b/dag/gunbc/host_standup_assimilation_deduction.dag index f21a1e2bb0e..d0c5ae11c20 100644 --- a/dag/gunbc/host_standup_assimilation_deduction.dag +++ b/dag/gunbc/host_standup_assimilation_deduction.dag @@ -1,5 +1,59 @@ module gunbc.host_standup_assimilation_deduction - +import std.types { + Bool, + Int, + List, + NonEmptyStr, + String, + Milliseconds, +} +import std.measure { + Millisecond, + millisecond, + millisecond_count, +} +import std.disposition { + Disposition, + Terminal, +} +import std.upsert_decision { + ObservationVerdict, + Converged, + Absent, + Drifted, + UnknownRefused, + Conflict, + Inaccessible, + UpsertDecision, + UpsertClassification, + Noop, + Apply, + Refuse, +} +import std.temporal_effect { + EffectStallBudget, + StallBudgetVerdict, + StallWithinBudget, + StallBudgetExceeded, + stall_budget_verdict, +} +import extdeps.router.verizon_cr1000a { Cr1000aDhcpLeaseTable } +import extdeps.bmc.types { + RedfishBootSourceOverrideMode, + BootOverrideModeUefi, +} +import product.placement_supply { HostIdentity } +import gunbc.fleet_intent_network { operator_host_srv3 } +import gunbc.network_identity_subsumption { + lease_table_has_os_up_subsumption, + srv3_pre_install_lease_table, + srv3_post_install_lease_table_fixture, +} +import gunbc.srv3_os_install_diagnostic { srv3_install_hang_no_router_lease_ms } +import gunbc.os_install_deduction { + KvmObservedScreen, + SubiquityStorageScreen, +} data gunbc_host_standup_assimilation_deduction_scope_disposition: Disposition = std.disposition.Terminal { reason: "Level-triggered assimilation deduction: OsInstalled from DHCP option-12 subsumption satisfies prefix:os-install-actuated and unlocks P0:host-identity-converge. Verdict authority is std.upsert_decision.ObservationVerdict (no parallel level enum). Happy path = lease read only; unreadable lease table → UnknownRefused, never Absent/Pending. Converged → UpsertDecision Noop. KVM/BMC weak surfaces consulted ONLY inside stall cause-fold." diff --git a/dag/gunbc/idea_pr_spine.dag b/dag/gunbc/idea_pr_spine.dag index 83ba96d34b6..cc59a826c19 100644 --- a/dag/gunbc/idea_pr_spine.dag +++ b/dag/gunbc/idea_pr_spine.dag @@ -1,4 +1,25 @@ module gunbc.idea_pr_spine +import std.types { List } +import std.reducible { + ReduceVerdict, + Reduced, + Irreducible, + Unknown, + reduce_verdicts_located, +} +import gunbc.review_verdict { + ReviewVerdict, + Approve, + ApproveWithComments, + RequestChanges, + NeedsHumanTriage, + NoVerdict, + ReviewProvider, + Llm, + Claude, + HumanReviewer, + ProviderOther, +} type WorkProduct = DesignPlan diff --git a/dag/gunbc/infer_occurrence_binding_scaffold.dag b/dag/gunbc/infer_occurrence_binding_scaffold.dag new file mode 100644 index 00000000000..a7972e975e5 --- /dev/null +++ b/dag/gunbc/infer_occurrence_binding_scaffold.dag @@ -0,0 +1,17 @@ +module gunbc.infer_occurrence_binding_scaffold + +import std.disposition { Disposition, Scaffold, SingleAuthority } +import std.decl_ref { DeclarationRef, WholeDeclaration } + +data infer_occurrence_binding_v1_adapter_scaffold: Disposition = Scaffold { + dissolves_to: SingleAuthority, + bind: DeclarationRef { + module_path: "std.occurrence_binding_resolve", + decl_name: "module_path_binding_decide", + field: WholeDeclaration + } +} + +data infer_occurrence_binding_v1_adapter_dissolve_trigger: String = "DISSOLVE-ON: stage0 emits generic std.occurrence_binding_resolve (BindingCandidate gains Clone/serde bounds); v1.compiler.infer_occurrence_binding deletes module_path_owner_binding_decide and delegates to module_path_binding_decide by execution. ROADMAP lane: namespace-canonical-binding." + +data infer_occurrence_binding_v1_adapter_receipt_plan_anchor: String = "docs/plans/namespace-unique-on-chain-operational-plan.md" diff --git a/dag/gunbc/install_media.dag b/dag/gunbc/install_media.dag index d910d545093..e39167db387 100644 --- a/dag/gunbc/install_media.dag +++ b/dag/gunbc/install_media.dag @@ -1,5 +1,18 @@ module gunbc.install_media - +import std.types { + String, + NonEmptyStr, +} +import std.upsert_decision { + ObservationVerdict, + Converged, + Absent, + Drifted, + UpsertDecision, + UpsertClassification, + Noop, + Apply, +} type SeededInstallMediaObservation = MediaAbsent diff --git a/dag/gunbc/language_source_scaffold_index.dag b/dag/gunbc/language_source_scaffold_index.dag index 44fca80e521..5e1e552161c 100644 --- a/dag/gunbc/language_source_scaffold_index.dag +++ b/dag/gunbc/language_source_scaffold_index.dag @@ -1,5 +1,13 @@ module gunbc.language_source_scaffold_index - +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} data language_source_scaffold_index_note: String = "B2 inventory for hand-authored target-language semantics in language files. Every blob of hand-written target source carries a row here whose disposition is a std.disposition Scaffold naming the construction that subsumes it, or a Terminal stating why it is irreducible. No string-content classifier is involved: the mark is a typed value, not prose to be parsed." diff --git a/dag/gunbc/namespace_unique_on_chain_policy_scaffold.dag b/dag/gunbc/namespace_unique_on_chain_policy_scaffold.dag new file mode 100644 index 00000000000..d4e747beb66 --- /dev/null +++ b/dag/gunbc/namespace_unique_on_chain_policy_scaffold.dag @@ -0,0 +1,41 @@ +module gunbc.namespace_unique_on_chain_policy_scaffold + +import std.disposition { Disposition, Scaffold, SingleAuthority } +import std.decl_ref { DeclarationRef, WholeDeclaration } + +data namespace_unique_on_chain_policy_hand_rust_scaffold: Disposition = Scaffold { + dissolves_to: SingleAuthority, + bind: DeclarationRef { + module_path: "test.retirement.namespace_unique_on_chain_policy_retained", + decl_name: "namespace_unique_on_chain_policy_retention", + field: WholeDeclaration + } +} + +data namespace_unique_on_chain_policy_hand_rust_dissolve_trigger: String = "DISSOLVE-ON: v1 self-host deletes src/v1 and the host thread-local NameResolutionPolicy gate; dag-native policy witnesses replace src/v1/tests/src/namespace_unique_on_chain_policy_test.rs (hand-Rust LOC after → 0). ROADMAP row: gunbc.roadmap_authority namespace-canonical-binding." + +data namespace_unique_on_chain_policy_hand_rust_receipt_plan_anchor: String = "gunbc.roadmap_authority namespace-canonical-binding" + +data namespace_unique_on_chain_policy_hand_rust_loc_before: Int = 244 + +data namespace_unique_on_chain_policy_hand_rust_loc_after: Int = 348 + +data namespace_unique_on_chain_policy_loc_delta_net: Int = 104 + +data namespace_unique_on_chain_policy_hand_rust_loc_census_note: String = "Hand-Rust keystone witness LOC census vs origin/main (src/v1/tests/src/namespace_unique_on_chain_policy_test.rs): before=244 after=348 net=+104. Interim growth is counted against ROADMAP row namespace-canonical-binding; dissolve-on deletes the rs (after → 0). A bare plan-filename is not the receipt — the checkable anchor is gunbc.roadmap_authority namespace-canonical-binding.\n\nGREW FROM +33 TO +104 (review 45364): the span-fabrication fix in v1.std.core diagnostic_to_span had to be provable by execution, not by inspection, and the dag witness corpus cannot reach it -- no dag/test/claim witness imports v1 at all, because the seed is not in the witness corpus's import universe. So the two discriminating tests live here: unknown_occurrence_refusal_renders_no_span_never_a_minted_pseudo_file (reds if the '' placeholder returns, because it rejects any span whose file names the occurrence id) and span_carrying_refusal_still_reports_its_authored_span (reds if the fix over-reaches and flattens real spans to no_span). Both green by execution." + +data namespace_unique_on_chain_policy_cli_run_hand_rust_loc_delta_net: Int = 83 + +data namespace_unique_on_chain_policy_cli_run_hand_rust_census_note: String = "THE SECOND HAND-RUST FILE THIS WORK GROWS, censused here because the first receipt did not cover it (review 45162). src/v1/stage0/src/cli_run.rs, net +83 vs the merge base. It is reported as a delta and ONLY as a delta, because whole-file LOC on a 32k-line host module measures the file, not this change — the same shape cli_run_witness_admission_hand_rust_loc_delta_net already uses for the same file.\n\nTHE ABSOLUTES WERE DELETED, DELIBERATELY (review 45409): this row used to carry a before/after LOC pair for cli_run.rs alongside the delta. PR #7483 then grew that file by roughly 1,556 lines, so both halves of the pair became false on the next merge while the delta stayed exactly right. The stale pair is not quoted here even as illustration -- a dead number reprinted in prose is still a number this carrier appears to assert, and a later reader grepping for it finds a hit. A before/after pair on a file another lane is actively rewriting is a second representation of a fact this row already owns, and it rots without anyone touching this carrier — the same failure the merge-repair row's stale '+7 lines' showed. The delta is the measure; the absolutes are not carried, so there is nothing here to go stale.\n\nWHAT GREW AND WHY IT IS HAND-RUST: the bulk is containment_resolve_fn_v1_for_module, which now routes the v1 containment census through the SAME chain+decide authority inference uses (module_path_owner_binding_decide, global_bare_unique_chain_candidate) so zero-on-chain never authorizes a whole-corpus search, including the nearest-ancestor LCP widen. That is the point of the node: one name-decision function rather than two that can disagree. Consolidating onto one authority necessarily grows the caller until the seed itself goes, so this is counted interim growth, not a shrink.\n\nIt cannot be a dag witness today for the reason the retention row already states: the census walks the seed interpreter's own resolution state through a host thread-local policy gate, and a substrate program has no handle to flip that gate. So there is no deleted path to point at and no shrink to claim — the honest receipt is a counted delta with a dissolution trigger, which is what this row is.\n\nDISSOLVE-ON: identical to the sibling census above — v1 self-host deletes src/v1 and with it both this growth and the policy gate it serves (delta -> 0). Checkable anchor: gunbc.roadmap_authority namespace-canonical-binding. See namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_census_note for the third lane file, which carries the PR total." + +data namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_loc_delta_net: Int = 14 + +data namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_census_note: String = "THE THIRD AND LAST HAND-RUST FILE THIS WORK GROWS. Found by enumerating every changed .rs against the generated roster in gunbc.stage0_emit_model rather than by inspecting the files this change was known to touch; the first receipt missed cli_run.rs (review 45162) and the follow-up receipt still missed this one, so the enumeration is the method that closes the class, not a third one-off. src/v1/stage0/src/module_path_index/parsed_dag_file.rs goes 39 -> 53, net +14.\n\nWHAT GREW AND WHY: parse_dag_file collapsed three distinct failure states -- read failed, parse error, parse produced no module -- into a single Option::None, which is the DESIGN section 5 state-space conflation, and it is what made the test-module hygiene bridge report the opaque unlocatable 'parse failed: ' with the real diagnostic discarded. The growth adds parse_dag_file_or_err returning a typed Result that names the cause and the path, and reduces parse_dag_file to a wrapper over it. This is growth that BUYS a located refusal, which is the direction section 5 asks for.\n\nHONEST RESIDUE, NOT CLAIMED FIXED: the Option-returning parse_dag_file wrapper is retained, so callers that have not migrated still discard the cause. This PR converts the caller that needed the located refusal; it does not delete the lossy wrapper. Removing it is a separate migration over the remaining callers.\n\nTOTAL: hand-Rust growth for this PR is +104 (policy witness) +83 (cli_run) +14 (parsed_dag_file) = +201. Earlier receipts on this PR claimed +33, then +116, then +130, then +205; each was true when written. The drop from 205 to 201 is not a correction but a DISSOLUTION: the merge-repair row censused 4 lines repairing #7490's stale typecheck_module callers, and its stated trigger was that the delta goes to zero once that repair lands on main independently. PR #7494 merged, so it did, and the row deleted itself rather than being carried as a permanent 4. The total is re-derived from the rows each time rather than carried forward. src/v1/stage0/src/cli_run/test_module_hygiene_bridge.rs also changed but is net 0 lines, so it adds no growth to census. Every other .rs in this diff is generated stage0 output listed in gunbc.stage0_emit_model and is regen product, not hand-maintained -- including std_occurrence_identity.rs, which a review characterized as censused hand-Rust growth and which is in fact generated (stage0_emit_model.dag:65).\n\nDISSOLVE-ON: same trigger as the two censuses above -- v1 self-host deletes src/v1 (delta -> 0). Checkable anchor: gunbc.roadmap_authority namespace-canonical-binding." + + + +data namespace_unique_on_chain_policy_containment_census_test_discriminator: String = "zero_on_chain_containment_census_matches_inference_unresolved" + +data namespace_unique_on_chain_policy_zero_on_chain_test_discriminator: String = "zero_on_chain_homonym_discriminates_the_diagnostic_label" + +data namespace_unique_on_chain_policy_single_off_chain_test_discriminator: String = "single_off_chain_unique_refuses_under_namespace_only" diff --git a/dag/gunbc/non_fold_residue.dag b/dag/gunbc/non_fold_residue.dag index bea6af74a2a..5a4202e3912 100644 --- a/dag/gunbc/non_fold_residue.dag +++ b/dag/gunbc/non_fold_residue.dag @@ -690,6 +690,11 @@ data non_fold_residue_frontier: List = [ reason: nfr_reason_observation_hold_cause, trigger: TriggerProse { text: nfr_dissolve_wildcard_total }, }, + FrontierRow { + subject: PathSubject { path: "dag/std/occurrence_identity.dag::occurrence_category_binding_verdict" }, + reason: nfr_reason_trait_derive_shape_table, + trigger: TriggerProse { text: "DISSOLVE-ON: OccurrenceCategory×OccurrenceCategory compatibility becomes a total derived table (or inhabitance-derived admissibility) and the nested wildcard arms delete with the row" }, + }, ] fn non_fold_residue_frontier_units() -> List { diff --git a/dag/gunbc/observation_ci_render.dag b/dag/gunbc/observation_ci_render.dag index 695873e0758..00e5ea040f7 100644 --- a/dag/gunbc/observation_ci_render.dag +++ b/dag/gunbc/observation_ci_render.dag @@ -1,86 +1,112 @@ module gunbc.observation_ci_render - -import std.types { String, NonEmptyStr, Bool, List } +import std.types { + Bool, + List, + NonEmptyStr, + String, +} import std.nat { Nat } import std.measure { - Nanosecond, - Millisecond, - ByteSize, BasisPoint, - nanosecond_count, - nanoseconds_per_millisecond, - nanosecond_to_millisecond_floor, - millisecond, - millisecond_count, - byte_size, - byte_size_count, + ByteSize, + Millisecond, + Nanosecond, basis_point, basis_point_count, + byte_size, + byte_size_count, gibibyte_scale_factor_bytes, + millisecond, + millisecond_count, milliseconds_per_second, + nanosecond_count, + nanosecond_to_millisecond_floor, + nanoseconds_per_millisecond, seconds_per_minute, } -import std.symbols { SymbolId, Tier, Emoji, Unicode, Ascii, StatusPulse, StatusDwell, StatusBlocked, StatusRefused, StatusFinal, NodeCompleted, NodeFailed, NodeRunning, NodeSkipped } -import std.disposition { Disposition, Terminal } +import std.symbols { + Ascii, + Emoji, + NodeCompleted, + NodeFailed, + NodeRunning, + NodeSkipped, + StatusBlocked, + StatusDwell, + StatusFinal, + StatusPulse, + StatusRefused, + SymbolId, + Tier, + Unicode, +} +import std.disposition { + Disposition, + Terminal, +} import extdeps.render.glyphs { resolve_symbol } -import extdeps.github.log_annotations { annotation_group_prefix, annotation_endgroup, neutralize_workflow_commands } +import extdeps.github.log_annotations { + annotation_endgroup, + annotation_group_prefix, + neutralize_workflow_commands, +} import std.observation { - ObservationSubject, - ObservationSegment, - RunSegment, + AdmissionWindow, + Ambient, + Anomaly, + AnomalyExpanded, + AttentionBasis, + AttentionLevel, BatchSegment, - EntrySegment, - ModuleSegment, + Begin, + ClassBlocked, + ClassDwellEscalation, + ClassRefused, + Concluded, + ContendedResource, + CurrentHighWater, DeclarationSegment, - PhaseSegment, - observation_subject_render, - observation_subject_contains, - observation_declaration_key, + Done, + DwellThreshold, + EntrySegment, + Failed, + Final, + MaturationReserve, Measured, - MeasuredValue, MeasuredUnavailable, + MeasuredValue, + MemoryBudget, + ModuleSegment, + Notable, + ObservationDensity, ObservationEvent, + ObservationEventClass, ObservationOutcome, - Done, + ObservationSegment, + ObservationSubject, + ObservationTransition, + PhaseSegment, + PsiPressure, Refused, - Failed, - TimedOut, + RoutineCollapsible, + RunSegment, + SchedulerHold, Skipped, - Final, - ObservationTransition, - Begin, Step, - Concluded, - ObservationEventClass, - ClassRefused, - ClassBlocked, - ClassDwellEscalation, - observation_event_class, - observation_presentation, - observation_class_density, - ObservationDensity, - RoutineCollapsible, SummaryAlwaysShown, - AnomalyExpanded, - observation_class_is_intrinsic_anomaly, - AttentionLevel, - Ambient, - Notable, - Anomaly, - AttentionBasis, + TimedOut, observation_attention, - DwellThreshold, + observation_class_density, + observation_class_is_intrinsic_anomaly, + observation_declaration_key, observation_dwell_threshold, observation_escalation_depth, observation_escalation_subject, - SchedulerHold, - PsiPressure, - CurrentHighWater, + observation_event_class, observation_hold_resource, - ContendedResource, - MemoryBudget, - AdmissionWindow, - MaturationReserve, + observation_presentation, + observation_subject_contains, + observation_subject_render, } data observation_ci_render_note: String = "P1 of the progress-and-observation lane: the CI-log renderer, built first because the CI log is where the pain lives. Append-only, no repaint — a GitHub Actions log cannot be redrawn, so every line is final when written. This module PROJECTS the std.observation event vocabulary into lines; it computes no facts of its own and holds no telemetry source. Every number it prints arrives in an event or a heartbeat sample that the process already had (law 5), which is why the flagship acceptance can replay a captured run: the renderer is a pure function of the stream." diff --git a/dag/gunbc/observation_seed_render.dag b/dag/gunbc/observation_seed_render.dag index 89992e251f7..8b1e9b5dfee 100644 --- a/dag/gunbc/observation_seed_render.dag +++ b/dag/gunbc/observation_seed_render.dag @@ -1,37 +1,62 @@ module gunbc.observation_seed_render - -import std.types { String, NonEmptyStr, Bool } +import std.types { + Bool, + NonEmptyStr, + String, +} import std.nat { Nat } -import std.symbols { Tier, Emoji, Unicode, StatusBlocked } -import std.measure { Nanosecond, Millisecond, millisecond, millisecond_to_nanosecond, byte_size, basis_point } -import std.measure { nanosecond, nanosecond_count } -import std.disposition { Disposition, Terminal } +import std.symbols { + Emoji, + StatusBlocked, + Tier, + Unicode, +} +import std.measure { + Millisecond, + Nanosecond, + basis_point, + byte_size, + millisecond, + millisecond_to_nanosecond, + nanosecond, + nanosecond_count, +} +import std.disposition { + Disposition, + Terminal, +} import std.observation { - ObservationSubject, - RunSegment, - EntrySegment, - DeclarationSegment, + Anomaly, + AttentionBasis, BatchSegment, - PhaseSegment, - ModuleSegment, - MeasuredValue, - MeasuredUnavailable, - ObservationEvent, Begin, Concluded, + CurrentHighWater, + DeclarationSegment, Done, + EntrySegment, Failed, - Refused, - TimedOut, Final, - AttentionBasis, - Anomaly, - SchedulerHold, + MeasuredUnavailable, + MeasuredValue, + ModuleSegment, + ObservationEvent, + ObservationSubject, + PhaseSegment, PsiPressure, - CurrentHighWater, + Refused, + RunSegment, + SchedulerHold, + TimedOut, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.render { + Clear, + RenderCapability, } -import std.decl_ref { DeclarationRef, WholeDeclaration } -import std.render { RenderCapability, Clear } import gunbc.observation_tty_render { TtyEmissionProjected, TtyEmissionRefused, @@ -47,13 +72,13 @@ import extdeps.render.terminal { project_terminal_write, } import gunbc.observation_ci_render { + HeartbeatSample, + RenderedLine, ci_event_line, - ci_render_line, ci_heartbeat_line, ci_hold_cause_text, ci_measurement_rss_line, - HeartbeatSample, - RenderedLine, + ci_render_line, } data observation_seed_render_note: String = "The seed to .dag render boundary. The v1 seed (claim_executor and its siblings) emits progress lines, but the FORMAT is a single authority in gunbc.observation_ci_render — a raw eprintln in the seed forks that format the way a hand-rolled duration string forks std.measure. This module is the boundary the seed calls across, exactly as cli_run.install_output_policy calls output_policy.resolve_channel_policy: primitive arguments in, a rendered line out, no format logic on the seed side. It constructs the ObservationEvent the seed's occurrence corresponds to (a phase concluding is a Concluded event on a PhaseSegment subject) and projects it through the existing renderer, so the seed cannot drift from the model. It holds no telemetry source and computes no facts of its own; every field it fills came in as an argument the seed already had (observation law 5)." diff --git a/dag/gunbc/observation_tty_render.dag b/dag/gunbc/observation_tty_render.dag index 5ba635935d4..5c3c5fbae13 100644 --- a/dag/gunbc/observation_tty_render.dag +++ b/dag/gunbc/observation_tty_render.dag @@ -1,68 +1,99 @@ module gunbc.observation_tty_render - -import std.types { String, NonEmptyStr, Bool, List } +import std.types { + Bool, + List, + NonEmptyStr, + String, +} import std.nat { Nat } -import std.measure { Millisecond, ByteSize, millisecond, millisecond_count } -import std.symbols { SymbolId, Tier, Emoji, Unicode, Ascii, Spinner0, StatusBlocked, StatusFinal, NodeRunning, NodeCompleted } -import std.render { CursorAction, Overwrite, Append, RenderCapability } -import std.disposition { Disposition, Terminal } -import extdeps.render.glyphs { resolve_symbol, reward_animal_at } +import std.measure { + ByteSize, + Millisecond, + millisecond, + millisecond_count, +} +import std.symbols { + Ascii, + Emoji, + NodeCompleted, + NodeRunning, + Spinner0, + StatusBlocked, + StatusFinal, + SymbolId, + Tier, + Unicode, +} +import std.render { + Append, + CursorAction, + Overwrite, + RenderCapability, +} +import std.disposition { + Disposition, + Terminal, +} +import extdeps.render.glyphs { + resolve_symbol, + reward_animal_at, +} import gunbc.observation_ci_render { RenderedLine, - ci_render_line, ci_event_line, ci_event_line_at_attention, - ci_human_duration, + ci_hold_cause_text, ci_human_bytes, + ci_human_duration, + ci_render_line, ci_subject_activity_text, ci_subject_detail_text, ci_subject_leaf_text, - ci_hold_cause_text, } import std.observation { - ObservationSubject, - Measured, - MeasuredValue, - ObservationEvent, - ObservationTransition, + AdmissionWindow, + Ambient, + Anomaly, + AnomalyExpanded, + AttentionAssigned, + AttentionBasis, + AttentionLevel, + AttentionRefused, Begin, - Step, + BlockedOn, Concluded, - ObservationOutcome, + ContendedResource, + ContentionRemaining, Done, - Refused, Failed, - TimedOut, - Skipped, Final, - ObservationEventClass, - observation_event_class, - observation_class_density, + MaturationReserve, + Measured, + MeasuredValue, + MemoryBudget, + Notable, + ObservationAttention, ObservationDensity, + ObservationEvent, + ObservationEventClass, + ObservationOutcome, + ObservationSubject, + ObservationTransition, + PsiPressure, + Refused, + RemainingBounded, + RemainingUnknown, RoutineCollapsible, + SchedulerHold, + Skipped, + Step, SummaryAlwaysShown, - AnomalyExpanded, - observation_presentation, - AttentionLevel, - Ambient, - Notable, - Anomaly, - AttentionBasis, - ObservationAttention, - AttentionAssigned, - AttentionRefused, + TimedOut, observation_attention, observation_attention_under, - BlockedOn, - ContendedResource, - MemoryBudget, - AdmissionWindow, - MaturationReserve, - ContentionRemaining, - RemainingUnknown, - RemainingBounded, - SchedulerHold, - PsiPressure, + observation_class_density, + observation_event_class, + observation_presentation, } data observation_tty_render_note: String = "P2 of the progress-and-observation lane: the interactive TTY renderer, a SIBLING projection of the same std.observation carriers the CI renderer projects — not a second model and not the CI renderer's successor. The two differ only where the medium differs. A terminal can be repainted, so routine progress overwrites one line in place and stays quiet; a CI log cannot, so it appends. Everything the two share — the event vocabulary, the density authority, the glyph table, the duration and byte and percent projections, the hold-cause text — is imported from the CI renderer or the model, never re-derived. That sharing is the proof that one event stream drives N renderers (DESIGN section 2); a TTY renderer that re-spelled ci_human_duration would be the fork this lane exists to avoid." diff --git a/dag/gunbc/plans/branch_merge_admission_model.dag b/dag/gunbc/plans/branch_merge_admission_model.dag index 795f597a51d..0521857dc18 100644 --- a/dag/gunbc/plans/branch_merge_admission_model.dag +++ b/dag/gunbc/plans/branch_merge_admission_model.dag @@ -1,5 +1,24 @@ module gunbc.plans.branch_merge_admission_model - +import gunbc.plan { + Plan, + HasTrigger, +} +import std.markdown { + MarkdownBlock, + TableBlock, + AlignNone, +} +import gunbc.plans.md_helpers { + h2, + h3, + p, + li, + ul, + ol, + cell, + row, + quote, +} fn status_block() -> MarkdownBlock { quote(blocks: [ diff --git a/dag/gunbc/plans/merge_admission_gate_shape_proposal.dag b/dag/gunbc/plans/merge_admission_gate_shape_proposal.dag index 61df3cd5e41..603580ce7cc 100644 --- a/dag/gunbc/plans/merge_admission_gate_shape_proposal.dag +++ b/dag/gunbc/plans/merge_admission_gate_shape_proposal.dag @@ -1,5 +1,23 @@ module gunbc.plans.merge_admission_gate_shape_proposal - +import gunbc.plan { + Plan, + HasTrigger, +} +import std.markdown { + MarkdownBlock, + TableBlock, + AlignNone, +} +import gunbc.plans.md_helpers { + h2, + h3, + p, + li, + ul, + cell, + row, + quote, +} fn status_block() -> MarkdownBlock { quote(blocks: [ diff --git a/dag/gunbc/pr_digests.dag b/dag/gunbc/pr_digests.dag index 41e70326e9a..d7a3ae7709f 100644 --- a/dag/gunbc/pr_digests.dag +++ b/dag/gunbc/pr_digests.dag @@ -1,5 +1,11 @@ module gunbc.pr_digests - +import extdeps.github.pulls { + PullRequest, + PullReview, + ReviewComment, +} +import extdeps.github.errors { GitHubErrorShape } +import std.types { NonEmptyStr } type MergeReadinessVerdict = Ready diff --git a/dag/gunbc/review_verdict.dag b/dag/gunbc/review_verdict.dag index f8adf9252b3..62c7f3ea841 100644 --- a/dag/gunbc/review_verdict.dag +++ b/dag/gunbc/review_verdict.dag @@ -1,5 +1,12 @@ module gunbc.review_verdict - +import std.types { + ArtifactId, + CommitSha, + ContentHash, + NonEmptyStr, + Timestamp, +} +import extdeps.github.pulls { ReviewState } type LlmReviewProvider = OpenaiPro diff --git a/dag/gunbc/runner_unit_live_read.dag b/dag/gunbc/runner_unit_live_read.dag index 01aa6a481ff..9ca2ec3ec01 100644 --- a/dag/gunbc/runner_unit_live_read.dag +++ b/dag/gunbc/runner_unit_live_read.dag @@ -1,5 +1,46 @@ module gunbc.runner_unit_live_read - +import std.types { + NonEmptyStr, + String, + Bool, +} +import std.measure { + ByteSize, + byte_size, + byte_size_count, +} +import std.disposition { + Disposition, + Terminal, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import extdeps.systemd { + SystemdCgroupMemoryLimit, + MemoryLimitUnbounded, + MemoryLimitBytes, + MemoryLimitAbsent, + parse_systemd_memory_limit_show, + systemd_memory_max_property, + systemd_memory_swap_max_property, + systemd_memory_high_property, +} +import gunbc.host_converge { + ConvergeTarget, + ConvergeVerdict, + VerdictConverged, + Drifted, + converge_verdict, +} +import gunbc.ci_floor_measurement { + RunnerSliceCapEffectiveness, + CapEffective, + CapUnbounded, +} type RunnerUnitLiveReadRow { unit: NonEmptyStr diff --git a/dag/gunbc/srv3_host_effect_apply.dag b/dag/gunbc/srv3_host_effect_apply.dag index c8f65b16a3a..edb1b2a975d 100644 --- a/dag/gunbc/srv3_host_effect_apply.dag +++ b/dag/gunbc/srv3_host_effect_apply.dag @@ -1,5 +1,50 @@ module gunbc.srv3_host_effect_apply - +import gunbc.host_effect { + HostEffect, + NodeControlPlane, + HostEffectIntent, + HostEffectEvidence, + ConvergePlanApplied, + Srv3InstallMediaFetch, + Srv3SeededInstallMediaRemaster, + Srv3SeededInstallMediaToolchainEnsure, + Srv3BmcwebSessionLogin, + Srv3BmcwebTokenExtract, + Srv3NbdProxyServe, + Srv3BootOnceReadBackSleep, + Srv3ReceiptEmit, + host_effect_read_evidence, + host_effect_identity_evidence, +} +import gunbc.host_effect_realize { + host_effect_apply, + host_effect_apply_gated, +} +import gunbc.ci_deploy_access { + ci_deploy_srv1_access, + DeployAccess, + deploy_access_check, + deploy_access_unprivileged_fixture_actor, +} +import extdeps.access.aws_iam { Deny } +import gunbc.os_install_actuator_selection { srv3_os_install_actuator_host } +import gunbc.srv3_nbd_proxy_serve_intent { srv3_nbd_proxy_serve_host_effect } +import std.realization_reconcile { + Reconciliation, + Converged, + NotConverged, + reconciliation_converged, +} +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import std.types { + String, + List, + Bool, +} type Srv3TypedReceipt { lines: List diff --git a/dag/gunbc/srv3_os_install_actuate.dag b/dag/gunbc/srv3_os_install_actuate.dag index 7289ad55ed5..7cffa145d00 100644 --- a/dag/gunbc/srv3_os_install_actuate.dag +++ b/dag/gunbc/srv3_os_install_actuate.dag @@ -1,4 +1,51 @@ module gunbc.srv3_os_install_actuate +import gunbc.srv3_os_install_actuate_scope { srv3_actuator_virtual_media_iso_install_path } +import gunbc.srv3_bmc_credential_resolve { + srv3_os_install_actuate_credential_intent, + bmcweb_login_body_content, + BmcCredentialResolution, + CredentialResolutionRefused, + UseFactoryCredential, + UseRotatedSecretRef, +} +import gunbc.srv3_host_effect_apply { + srv3_bmcweb_session_login_apply, + srv3_bmcweb_token_extract_apply, + srv3_nbd_proxy_serve_apply, + srv3_reconciliation_to_process_exit, +} +import gunbc.srv3_actuate_shell_paths { + srv3_bmcweb_login_body_path, + srv3_bmcweb_login_response_path, + srv3_bmcweb_token_path, +} +import gunbc.nbd_proxy_virtual_media_install { + srv3_os_install_actuator_plan, + os_install_actuator_step_count, +} +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import std.types { + String, + NonEmptyStr, +} +import std.cache_interface { Network } +import std.disposition { + Disposition, + Terminal, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} + +import extdeps.shell +import extdeps.filesystem.filesystem_io data gunbc_srv3_os_install_actuate_scope_disposition: Disposition = std.disposition.Terminal { diff --git a/dag/gunbc/srv3_seeded_install_media.dag b/dag/gunbc/srv3_seeded_install_media.dag index 7f0cad407e8..ecb3a0fc6c8 100644 --- a/dag/gunbc/srv3_seeded_install_media.dag +++ b/dag/gunbc/srv3_seeded_install_media.dag @@ -1,5 +1,51 @@ module gunbc.srv3_seeded_install_media - +import extdeps.provisioning.ubuntu_seeded_install_media_toolchain { + install_media_remaster_toolchain_requirement, + install_media_remaster_toolchain_is_complete, +} +import extdeps.os.ubuntu_autoinstall { NoCloudLocal } +import gunbc.os_install { srv3_ubuntu_autoinstall_on_iso } +import gunbc.srv3_seeded_install_media_artifact { + srv3_seeded_install_media_artifact, + srv3_seeded_ubuntu_install_media_install_path, + srv3_seeded_grub_kernel_cmdline, + srv3_seeded_install_media_content_hash, + srv3_autoinstall_user_data_body, +} +import gunbc.srv3_host_effect_apply { + srv3_seeded_install_media_toolchain_ensure_apply, + srv3_seeded_install_media_remaster_apply, + srv3_reconciliation_to_process_exit, + srv3_seeded_install_media_toolchain_unprivileged_fixture_denied, +} +import gunbc.host_effect_realize { srv3_seeded_install_media_toolchain_privileged_apt_install_is_gated } +import gunbc.os_install_actuator_selection { srv3_os_install_actuator_host } +import gunbc.fleet_intent { + srv1_host, + ComputeHost, +} +import std.disposition { + Disposition, + RealizationDispatch, + Scaffold, + SingleAuthority, + Terminal, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import std.types { + NonEmptyStr, + String, + Bool, +} +import std.cache_interface { Network } data gunbc_srv3_seeded_install_media_scope_disposition: Disposition = std.disposition.Terminal { reason: "srv3 seeded autoinstall ISO — remaster stock ISO with embedded nocloud user-data + GRUB autoinstall ds=nocloud; content-hash keyed on stock sha256 + autoinstall payload; dissolves NoCloudNet seed-delivery gap when proven by unattended boot execution." diff --git a/dag/gunbc/stage0_emit_model.dag b/dag/gunbc/stage0_emit_model.dag index c6195c47130..df3719f7c5a 100644 --- a/dag/gunbc/stage0_emit_model.dag +++ b/dag/gunbc/stage0_emit_model.dag @@ -1,5 +1,14 @@ module gunbc.stage0_emit_model - +import extdeps.languages.rust.emit { + rust_qualified_module_mod_basename, + rust_qualified_module_mod_filename, +} +import std.types { + List, + String, + Bool, + Int, +} data generated_stage0_files: List = [ "compiler_tests.rs", @@ -84,6 +93,7 @@ data generated_stage0_files: List = [ "v1_compiler_infer_items.rs", "v1_compiler_infer_lookup.rs", "v1_compiler_infer_method.rs", + "v1_compiler_infer_occurrence_binding.rs", "v1_compiler_infer_patterns.rs", "v1_compiler_infer_resolve.rs", "v1_compiler_infer_service.rs", diff --git a/dag/gunbc/tailscale_acl_emit.dag b/dag/gunbc/tailscale_acl_emit.dag index ede223214c1..be5d1f3dea4 100644 --- a/dag/gunbc/tailscale_acl_emit.dag +++ b/dag/gunbc/tailscale_acl_emit.dag @@ -1,5 +1,27 @@ module gunbc.tailscale_acl_emit - +import std.types { + NonEmptyStr, + List, +} +import extdeps.languages.json.emit { + JsonValue, + JsonKeyValue, + serialize_json, + json_string, + json_array, + json_object, + json_kv, +} +import extdeps.tailscale.acl { + TailscaleGrant, + TailscaleSshRule, + TailscaleNodeAttr, + TailscaleTagOwnerRow, + TailscaleAclSelector, + TailscaleAclPolicy, + render_tailscale_acl_selector, + operator_tailscale_acl_policy, +} fn selector_array_json(items: List) -> JsonValue { json_array(elements: items |> map(s => json_string(s: render_tailscale_acl_selector(s: s)))) diff --git a/dag/gunbc/tailscale_acl_phase2_credential.dag b/dag/gunbc/tailscale_acl_phase2_credential.dag index 943911fd892..c9962bda609 100644 --- a/dag/gunbc/tailscale_acl_phase2_credential.dag +++ b/dag/gunbc/tailscale_acl_phase2_credential.dag @@ -1,5 +1,55 @@ module gunbc.tailscale_acl_phase2_credential - +import std.types { + Bool, + List, + NonEmptyStr, + Secret, + String, +} +import std.measure { + Second, + measure_add, + measure_le, + second, + second_count, +} +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + NamedField, + WholeDeclaration, +} +import std.cache_interface { Network } +import extdeps.cloud.gcp.gcp { + AdcRefresh, + GcpOAuth2AccessTokenStrategy, +} +import extdeps.cloud.gcp.iam { role_secretmanager_secret_accessor } +import gunbc.assimilate.bmc_token_federation { + SecretAccessBinding, + bmc_assimilator_sa_member, + bmc_federated_github_repo, + bmc_secrets_project_id, + bmc_wif_principal_set, +} +import gunbc.fleet_posix_accounts { + fleet_operator_email, + fleet_operator_gcp_iam_member, +} +import gunbc.tailscale_acl_emit { expected_tailscale_acl_json } +import extdeps.tailscale.acl { + TailscaleAclPolicy, + operator_acl_security_spine_holds, +} +import gunbc.auth.credentials { + gcp_oauth_access_token, + gcp_secret_credential, +} +import gunbc.auth.optional_impersonation { optional_impersonation } data tailscale_acl_ephemeral_token_secret_id: NonEmptyStr = "tailscale-acl-ephemeral-token" diff --git a/dag/gunbc/test_module_hygiene.dag b/dag/gunbc/test_module_hygiene.dag index 534628673c6..836ed1d765a 100644 --- a/dag/gunbc/test_module_hygiene.dag +++ b/dag/gunbc/test_module_hygiene.dag @@ -2,7 +2,7 @@ module gunbc.test_module_hygiene import std.types { String, Bool, List } import v2.std.optional { Absent, Optional, Present, optional_absent, optional_present } -import v2.workflow.floor_discovery_producer { floor_discovery_scan_test_decl_names } +import v2.workflow.floor_naming_hygiene { floor_discovery_scan_test_decl_names } data test_module_hygiene_authority_note: String = "U2 orphan enroll-or-refuse + U3 file-grain expand authority (proud-wren-892). Pure fold over ModuleSurface — refs are already-extracted local names (call + bare-var). Host realizes parse Node→surface, FS walk, and interpreter transport (cli_run/test_module_hygiene_bridge.rs). Equivalence: dag/test/claim/test_module_hygiene_hand_rust_equivalence_witness_test.dag + cli_run.rs test_module_hygiene_bridge_equivalence_tests. ROADMAP node v1-test-hygiene-producer-retirement: seed producer deleted; bind is gunbc.test_module_hygiene.orphan_plain_names_or_refuse." diff --git a/dag/gunbc/tools/bmc_first_contact.dag b/dag/gunbc/tools/bmc_first_contact.dag index f8e9c344930..d912e613b63 100644 --- a/dag/gunbc/tools/bmc_first_contact.dag +++ b/dag/gunbc/tools/bmc_first_contact.dag @@ -1,4 +1,19 @@ module gunbc.tools.bmc_first_contact +import extdeps.bmc.openbmc { openbmc_factory_login } +import std.types { + NonEmptyStr, + String, + Secret, +} +import std.cache_interface { Network } +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} + +import extdeps.shell +import extdeps.bmc.http func bmc_first_contact() -> ProcessExit diff --git a/dag/gunbc/tools/bmc_onboard_validate.dag b/dag/gunbc/tools/bmc_onboard_validate.dag index b9dc7234621..3d2ecf07ab6 100644 --- a/dag/gunbc/tools/bmc_onboard_validate.dag +++ b/dag/gunbc/tools/bmc_onboard_validate.dag @@ -1,4 +1,17 @@ module gunbc.tools.bmc_onboard_validate +import std.types { + NonEmptyStr, + Secret, +} +import std.cache_interface { Network } +import std.process { + ExitSuccess, + ProcessExit, + exit_failure, +} +import gunbc.bmc_onboarding { srv3_onboarding_plan } + +import extdeps.bmc.http func bmc_onboard_validate() -> ProcessExit diff --git a/dag/gunbc/tools/bmc_read_telemetry.dag b/dag/gunbc/tools/bmc_read_telemetry.dag index e2db85d0112..3c0391440e7 100644 --- a/dag/gunbc/tools/bmc_read_telemetry.dag +++ b/dag/gunbc/tools/bmc_read_telemetry.dag @@ -1,4 +1,18 @@ module gunbc.tools.bmc_read_telemetry +import extdeps.boards.asrock_rack { asrock_altrad8ud_redfish_chassis_id } +import std.types { + NonEmptyStr, + String, +} +import std.cache_interface { Network } +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} + +import extdeps.shell +import extdeps.bmc.http func bmc_read_telemetry() -> ProcessExit diff --git a/dag/gunbc/tools/card_intake.dag b/dag/gunbc/tools/card_intake.dag index 2dba74bb41f..fc84a924053 100644 --- a/dag/gunbc/tools/card_intake.dag +++ b/dag/gunbc/tools/card_intake.dag @@ -1,5 +1,38 @@ module gunbc.tools.card_intake +import std.types { + FilePath, + NonEmptyStr, +} +import std.credentials { + CredentialSource, + EnvVar, +} +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import extdeps.llm.anthropic { + AnthropicChatMessage, + UserMessage, + UserTextBlock, + AnthropicImageBlock, + ImageSource, + Base64Image, + AnthropicImageMediaType, + ImageJpeg, +} +import extdeps.llm.anthropic_rest +import extdeps.filesystem.filesystem_io +import extdeps.tcgplayer.tcgplayer +import extdeps.tcgplayer.catalog +import extdeps.tcgplayer.pricing +import extdeps.tcgplayer.store data tcgplayer_client_id_source: CredentialSource = std.credentials.EnvVar { name: "TCGPLAYER_CLIENT_ID" } diff --git a/dag/gunbc/tools/ebay_listing.dag b/dag/gunbc/tools/ebay_listing.dag index 4725078d474..f9279ec7562 100644 --- a/dag/gunbc/tools/ebay_listing.dag +++ b/dag/gunbc/tools/ebay_listing.dag @@ -1,5 +1,20 @@ module gunbc.tools.ebay_listing +import std.types { NonEmptyStr } +import std.currency { + CurrencyCode, + Usd, +} +import std.credentials { + CredentialSource, + EnvVar, +} +import extdeps.ebay.ebay { + MarketplaceEnum, + marketplace_wire_label, +} +import extdeps.ebay.oauth +import extdeps.ebay.inventory data ebay_client_id_source: CredentialSource = std.credentials.EnvVar { name: "EBAY_CLIENT_ID" } diff --git a/dag/gunbc/tools/grounding_confirm.dag b/dag/gunbc/tools/grounding_confirm.dag index 8fd35c30a2a..4ce059bfb3e 100644 --- a/dag/gunbc/tools/grounding_confirm.dag +++ b/dag/gunbc/tools/grounding_confirm.dag @@ -1,5 +1,7 @@ module gunbc.tools.grounding_confirm +import extdeps.llm.anthropic +import extdeps.llm.anthropic_rest data eval_corpus_path: String = "src/v2/lens/testdata/anemia_confirm_eval_corpus.json" diff --git a/dag/gunbc/tools/review.dag b/dag/gunbc/tools/review.dag index b74458049ed..8920680f621 100644 --- a/dag/gunbc/tools/review.dag +++ b/dag/gunbc/tools/review.dag @@ -1,7 +1,23 @@ module gunbc.tools.review +import std.types { + FilePath, + GitRef, +} +import extdeps.llm.anthropic { + AnthropicChatMessage, + UserMessage, + UserTextBlock, +} +import extdeps.cron.schedule_model { + CronSchedule, + render_cron_schedule, +} +import extdeps.github.pulls { PullReview } +import v2.std.algebra { contains } +import gunbc.tools.cron_tag { upsert_tagged_cron_tab } import extdeps.git -import std.types { GitRef, FilePath } + data default_model: String = "claude-sonnet-4-6-20250929" data cron_schedule: CronSchedule = CronSchedule { diff --git a/dag/gunbc/tools/review_codex.dag b/dag/gunbc/tools/review_codex.dag index 963540c24ad..37897f34d32 100644 --- a/dag/gunbc/tools/review_codex.dag +++ b/dag/gunbc/tools/review_codex.dag @@ -1,4 +1,12 @@ module gunbc.tools.review_codex +import std.credentials { CredentialSource } +import extdeps.cron.schedule_model { + CronSchedule, + render_cron_schedule, +} +import extdeps.github.pulls { PullReview } +import v2.std.algebra { contains } +import gunbc.tools.cron_tag { upsert_tagged_cron_tab } import extdeps.shell diff --git a/dag/gunbc/tools/roadmap_spawn_request.dag b/dag/gunbc/tools/roadmap_spawn_request.dag index 54f389585ab..e07487cb034 100644 --- a/dag/gunbc/tools/roadmap_spawn_request.dag +++ b/dag/gunbc/tools/roadmap_spawn_request.dag @@ -1,4 +1,11 @@ module gunbc.tools.roadmap_spawn_request +import gunbc.roadmap_spawner { roadmap_spawn_request_json } +import gunbc.roadmap_authority { + roadmap_authority, + authored_merged_prs, +} + +import extdeps.git func roadmap_next_spawnable() -> String { diff --git a/dag/gunbc/witness_row_cost.dag b/dag/gunbc/witness_row_cost.dag index 01b4be75a21..9f502e410a8 100644 --- a/dag/gunbc/witness_row_cost.dag +++ b/dag/gunbc/witness_row_cost.dag @@ -1,53 +1,63 @@ module gunbc.witness_row_cost - import std.logic { Bool } import std.nat { Nat } -import std.types { NonEmptyStr, List, Int } +import std.types { + Int, + List, + NonEmptyStr, +} import std.measure { - Nanosecond, - nanosecond, - nanosecond_count, Millisecond, + Nanosecond, millisecond, millisecond_count, + nanosecond, + nanosecond_count, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, } -import std.decl_ref { DeclarationRef, WholeDeclaration } import std.observation { - ObservationEvent, - ObservationSubject, - ObservationSegment, - EntrySegment, - DeclarationSegment, - PhaseSegment, - RunSegment, + BatchGrain, BatchSegment, - ModuleSegment, - ObservationGrain, + Begin, + Concluded, DeclarationGrain, - RunGrain, - BatchGrain, + DeclarationSegment, + Done, EntryGrain, - ModuleGrain, - PhaseGrain, - observation_subject_grain, - observation_subject_entry_path, - observation_subject_declaration, - observation_subject_phase_name, - observation_subject_module_path, + EntrySegment, + Failed, Measured, - MeasuredValue, MeasuredUnavailable, - ObservationTransition, - Begin, - Step, - Concluded, + MeasuredValue, + ModuleGrain, + ModuleSegment, + ObservationEvent, + ObservationGrain, ObservationOutcome, - Done, + ObservationSegment, + ObservationSubject, + ObservationTransition, + PhaseGrain, + PhaseSegment, Refused, - Failed, + RunGrain, + RunSegment, + Step, TimedOut, + observation_subject_declaration, + observation_subject_entry_path, + observation_subject_grain, + observation_subject_module_path, + observation_subject_phase_name, +} +import v2.std.optional { + Absent, + Optional, + Present, } -import v2.std.optional { Absent, Optional, Present } import v2.std.text { String } data witness_row_cost_spine_note: String = "Per-witness cost receipts (placement workstream #5 spine). THE RECORD is std.observation.ObservationEvent (progress-observation-design §2/§3c) — not a TSV schema and not WitnessTimingRow. Production shape is N+1 per entry: exactly ONE entry resolve-phase Concluded event (entry-level/shared resolve wall) plus one declaration-grain Concluded event per witness (eval wall + actual outcome; Refused distinct from Failed). RSS is MeasuredUnavailable with an explicit cause. The canonical event and joined receipt retain exact Nanosecond eval, resolve, and warm values; histogram, ordering, and attribution consume those exact values. The TSV/drift/placement wires are named Millisecond presentation and policy boundaries and may floor only there. The resolve column repeats the observed full entry resolve for each child — never divided across witnesses and never summed N times into a corpus total. W2 filters the SAME events via AttentionLevel/ObservationDensity (Ambient may suppress a render line while the complete receipt still retains the row). Basis values MUST cite an arm64 srv-fleet run id (never local x86). A row with no dated basis is BasisAbsent. Drift is falsifier-cadence counted, not merge-refusing. Executing consumers: dag/test/claim/witness_row_cost_drift_witness_test.dag and dag/test/claim/witness_row_cost_projection_witness_test.dag." diff --git a/dag/product/compute_fabric.dag b/dag/product/compute_fabric.dag index 00a5575a6c6..2cc035d8837 100644 --- a/dag/product/compute_fabric.dag +++ b/dag/product/compute_fabric.dag @@ -1,5 +1,15 @@ module product.compute_fabric - +import std.types { + NonEmptyStr, + Bool, + List, +} +import std.measure { + HardwareThreadCount, + hardware_thread_count, + hardware_thread_count_value, + measure_le, +} type Fabric = NonEmptyStr where brand("Fabric") diff --git a/dag/product/hardware_selection.dag b/dag/product/hardware_selection.dag index 70e414e3b52..22ef1d1dfd7 100644 --- a/dag/product/hardware_selection.dag +++ b/dag/product/hardware_selection.dag @@ -1,5 +1,50 @@ module product.hardware_selection - +import std.types { + Int, + NonEmptyStr, + Bool, + List, +} +import std.nat { Nat } +import std.measure { + Measure, + Power, + Milli, + measure_count, + ByteSize, + byte_size, + byte_size_count, + bit_width_count, + bits_per_byte, + Watt, + watt, + watt_count, + Bandwidth, + MoneyAmountMicro, + money_amount_micro, + money_amount_micro_count, +} +import extdeps.cpu.types { + CpuModelCatalogRow, + CpuSocket, +} +import extdeps.memory.types { + DramModuleCatalogRow, + dram_chips_per_rank, + dram_module_is_realizable, + dram_data_word_width, + JedecDdrGenerationCatalogRow, +} +import std.pareto { + AxisComparison, + DominanceVerdict, + HigherIsBetter, + LowerIsBetter, + axis_comparison_int, + dominance_of_comparisons, + verdict_dominates, + on_pareto_front, +} type Milliwatt = Measure diff --git a/dag/shared/dag_util.dag b/dag/shared/dag_util.dag index cfe482947e9..d0b04a826ed 100644 --- a/dag/shared/dag_util.dag +++ b/dag/shared/dag_util.dag @@ -1,5 +1,8 @@ module shared.dag_util - +import std.types { + StageResult, + Summary, +} fn aggregate_results(stages: List) -> Summary { let passed_list = filter(stages, s => s.success) diff --git a/dag/std/determinism.dag b/dag/std/determinism.dag index 09aa0320fe6..d87cba45ec4 100644 --- a/dag/std/determinism.dag +++ b/dag/std/determinism.dag @@ -1,5 +1,10 @@ module std.determinism - +import std.perturbation { + PerturbationVerdict, + ResponseConsistent, + ResponseViolation, +} +import std.decl_ref { DeclarationRef } type Determinism = Deterministic diff --git a/dag/std/fermi.dag b/dag/std/fermi.dag index ad7e9b3858d..fa7edbaf35c 100644 --- a/dag/std/fermi.dag +++ b/dag/std/fermi.dag @@ -1,5 +1,9 @@ module std.fermi - +import std.algebra { BoundedLattice } +import std.types { + FermiDepth, + Milliseconds, +} fn fermi_ordinal(depth: FermiDepth) -> Int { match depth { diff --git a/dag/std/occurrence_binding_resolve.dag b/dag/std/occurrence_binding_resolve.dag new file mode 100644 index 00000000000..ac1644ee4cc --- /dev/null +++ b/dag/std/occurrence_binding_resolve.dag @@ -0,0 +1,225 @@ +module std.occurrence_binding_resolve + +import std.algebra { FreeMonoid, Empty } +import std.types { String, Bool } +import std.occurrence_binding { + ContainmentPath, + BindingOccurrence, + BindingCandidate, + OccurrenceBindingResult, + occurrence_binding_from_candidates, +} +import std.occurrence_identity { + OccurrenceId, + OccurrenceContainmentPath, + OccurrenceTransport, + OccurrenceTransportRefusal, + OccurrenceTransportValidated, + OccurrenceTransportRefused, + MissingAuthoredOccurrenceIdentity, + UnknownOccurrenceIdentity, + ValidatedOccurrenceTransport, + OccurrenceIndexEntry, + DeclarationOccurrence, + ReferenceOccurrence, + OccurrenceCategoryBindingAdmissible, + OccurrenceCategoryBindingInadmissible, + occurrence_containment_path_is_prefix_of, + occurrence_category_binding_verdict, + occurrence_transport_validate, +} + +data occurrence_binding_resolve_authority_note: String = "THE one name-decision function for namespace canonical binding. Every type, value, and callee resolution path routes candidate populations through std.occurrence_binding occurrence_binding_from_candidates, called directly. There is no forwarding wrapper: occurrence_binding_decide was a signature-identical forwarder around that function, so it was a second public name for one decision -- the section 3 nickname this module exists to prevent, in the module that claims to prevent it (review 45443). Deleted; callers here and in the witness suite now name the authority. Candidate producers enumerate structurally admissible declarations; cardinality is never decided elsewhere." + +data occurrence_binding_resolve_module_path_scaffold_note: String = "STAGED ADOPTION: module-path keyed candidate producers (global_bare chain, func parent closure) bridge owner module paths into BindingCandidate containment paths until every production reference site threads exact OccurrenceContainmentPath identity from OccurrenceTransport. Cardinality still folds only through occurrence_binding_from_candidates." + +data occurrence_binding_resolve_module_path_scaffold_dissolve_on: String = "DISSOLVE-ON: type, value, and callee production consumers enumerate BindingCandidate from OccurrenceTransport by execution; then delete module-path scaffold producers and both scaffold rows." + +data occurrence_binding_resolve_transport_boundary_note: String = "Transport validity is outside OccurrenceBindingResult (review 45043): malformed transports refuse as OccurrenceReferenceBindingTransportRefused before any Bound/Unbound/Ambiguous decision. ValidatedOccurrenceTransport.entries_by_id and .references_by_id are the indexed lookup authorities — resolvers never rescan OccurrenceIndex.entries per declaration, and reference_occurrence_by_id is a map_get on the carried index rather than a filter over the references list (review 45329). resolve_reference_occurrence_binding takes only OccurrenceId (review 45106): the ReferenceOccurrence row and authored segment are derived from the validated carrier — caller-supplied reference/segment facts cannot bypass that authority." + +fn occurrence_containment_to_binding_path( + path: OccurrenceContainmentPath +) -> ContainmentPath { + ContainmentPath { + ancestors: path.ancestors, + terminal: path.terminal, + } +} + +fn binding_occurrence_from_reference( + reference: ReferenceOccurrence +) -> BindingOccurrence { + BindingOccurrence { + containment: occurrence_containment_to_binding_path( + path: reference.containment, + ), + } +} + +fn binding_candidate_from_declaration( + declaration: DeclarationOccurrence +) -> BindingCandidate { + BindingCandidate { + containment: occurrence_containment_to_binding_path( + path: declaration.containment, + ), + } +} + +fn occurrence_index_entry_for_declaration( + validated: ValidatedOccurrenceTransport, + declaration: DeclarationOccurrence +) -> OccurrenceIndexEntry? { + map_get(validated.entries_by_id, declaration.occurrence.value) +} + +fn declaration_exposed_on_reference_chain( + declaration: DeclarationOccurrence, + reference: ReferenceOccurrence +) -> Bool { + occurrence_containment_path_is_prefix_of( + prefix: declaration.containment, + path: reference.containment, + ) +} + +fn binding_candidates_for_reference( + validated: ValidatedOccurrenceTransport, + reference: ReferenceOccurrence, + segment: String +) -> FreeMonoid> { + fold( + validated.declarations, + init: Empty, + f: (acc, declaration) => + match occurrence_index_entry_for_declaration( + validated: validated, + declaration: declaration, + ) { + Absent => acc + Present { value: entry } => + if entry.projection.authored_name != segment { + acc + } else if !declaration_exposed_on_reference_chain( + declaration: declaration, + reference: reference, + ) { + acc + } else { + match occurrence_category_binding_verdict( + reference: reference.category, + declaration: declaration.category, + ) { + OccurrenceCategoryBindingAdmissible => + concat( + acc, + [binding_candidate_from_declaration(declaration: declaration)], + ) + OccurrenceCategoryBindingInadmissible { + reference: _, + declaration: _, + } => acc + } + } + }, + ) +} + +type OccurrenceReferenceBindingOutcome + = OccurrenceReferenceBindingDecided { + result: OccurrenceBindingResult, + } + | OccurrenceReferenceBindingTransportRefused { + refusal: OccurrenceTransportRefusal, + } + +fn reference_occurrence_by_id( + validated: ValidatedOccurrenceTransport, + occurrence: OccurrenceId +) -> ReferenceOccurrence? { + map_get(validated.references_by_id, occurrence.value) +} + +fn resolve_reference_occurrence_binding_validated( + validated: ValidatedOccurrenceTransport, + occurrence: OccurrenceId +) -> OccurrenceReferenceBindingOutcome { + match map_get(validated.entries_by_id, occurrence.value) { + Absent => + match reference_occurrence_by_id(validated: validated, occurrence: occurrence) { + Present { value: reference } => + OccurrenceReferenceBindingTransportRefused { + refusal: MissingAuthoredOccurrenceIdentity { + diagnostic_span: reference.diagnostic_span, + }, + } + Absent => + OccurrenceReferenceBindingTransportRefused { + refusal: UnknownOccurrenceIdentity { occurrence: occurrence }, + } + } + Present { value: entry } => + match reference_occurrence_by_id(validated: validated, occurrence: occurrence) { + Absent => + OccurrenceReferenceBindingTransportRefused { + refusal: MissingAuthoredOccurrenceIdentity { + diagnostic_span: entry.projection.diagnostic_span, + }, + } + Present { value: reference } => + OccurrenceReferenceBindingDecided { + result: occurrence_binding_from_candidates( + occurrence: binding_occurrence_from_reference(reference: reference), + candidates: binding_candidates_for_reference( + validated: validated, + reference: reference, + segment: entry.projection.authored_name, + ), + ), + } + } + } +} + +fn resolve_reference_occurrence_binding( + transport: OccurrenceTransport, + occurrence: OccurrenceId +) -> OccurrenceReferenceBindingOutcome { + match occurrence_transport_validate(transport: transport) { + OccurrenceTransportRefused { refusal: refusal } => + OccurrenceReferenceBindingTransportRefused { refusal: refusal } + OccurrenceTransportValidated { transport: validated } => + resolve_reference_occurrence_binding_validated( + validated: validated, + occurrence: occurrence, + ) + } +} + +fn module_path_binding_occurrence(module_path: String) -> BindingOccurrence { + BindingOccurrence { + containment: ContainmentPath { + ancestors: Empty, + terminal: module_path, + }, + } +} + +fn module_path_binding_candidate(owner: String) -> BindingCandidate { + BindingCandidate { + containment: ContainmentPath { + ancestors: Empty, + terminal: owner, + }, + } +} + +fn module_path_binding_decide( + env_module_path: String, + owners: List +) -> OccurrenceBindingResult { + occurrence_binding_from_candidates( + occurrence: module_path_binding_occurrence(module_path: env_module_path), + candidates: owners |> map(owner => module_path_binding_candidate(owner: owner)), + ) +} diff --git a/dag/std/occurrence_identity.dag b/dag/std/occurrence_identity.dag index de23394635e..82abf3eb35d 100644 --- a/dag/std/occurrence_identity.dag +++ b/dag/std/occurrence_identity.dag @@ -1,7 +1,7 @@ module std.occurrence_identity import std.algebra { FreeMonoid } -import std.types { Bool, Int, String, SourceSpan } +import std.types { Bool, Int, String, SourceSpan, is_prefix_of } data occurrence_identity_scope_law: String = "OccurrenceId values are unique only inside one explicit graph-scoped OccurrenceIdAllocator. A production source graph threads one allocator across every parsed source; a standalone parse creates one isolated allocator scope. Filename, SourceSpan, authored name, structural Node equality, content hash, and module-local allocator reset are forbidden identity inputs." @@ -41,6 +41,81 @@ type OccurrenceCategory | FieldOccurrence | MethodOccurrence +type OccurrenceCategoryBindingVerdict + = OccurrenceCategoryBindingAdmissible + | OccurrenceCategoryBindingInadmissible { + reference: OccurrenceCategory, + declaration: OccurrenceCategory, + } + +data occurrence_category_binding_verdict_note: String = "Canonical reference×declaration category compatibility surface (review 44773 predicate-dissolution): consumers match OccurrenceCategoryBindingVerdict directly — not a parallel Bool predicate over the OccurrenceCategory coproduct." + +fn occurrence_category_binding_verdict( + reference: OccurrenceCategory, + declaration: OccurrenceCategory +) -> OccurrenceCategoryBindingVerdict { + match reference { + TypeOccurrence => + match declaration { + TypeOccurrence => OccurrenceCategoryBindingAdmissible + _ => OccurrenceCategoryBindingInadmissible { + reference: reference, + declaration: declaration, + } + } + LexicalValueOccurrence => + match declaration { + LexicalValueOccurrence => OccurrenceCategoryBindingAdmissible + CallableOccurrence => OccurrenceCategoryBindingAdmissible + ConstructorOccurrence => OccurrenceCategoryBindingAdmissible + _ => OccurrenceCategoryBindingInadmissible { + reference: reference, + declaration: declaration, + } + } + CallableOccurrence => + match declaration { + CallableOccurrence => OccurrenceCategoryBindingAdmissible + _ => OccurrenceCategoryBindingInadmissible { + reference: reference, + declaration: declaration, + } + } + ConstructorOccurrence => + match declaration { + ConstructorOccurrence => OccurrenceCategoryBindingAdmissible + _ => OccurrenceCategoryBindingInadmissible { + reference: reference, + declaration: declaration, + } + } + FieldOccurrence => + match declaration { + FieldOccurrence => OccurrenceCategoryBindingAdmissible + _ => OccurrenceCategoryBindingInadmissible { + reference: reference, + declaration: declaration, + } + } + MethodOccurrence => + match declaration { + MethodOccurrence => OccurrenceCategoryBindingAdmissible + _ => OccurrenceCategoryBindingInadmissible { + reference: reference, + declaration: declaration, + } + } + NamespaceSegmentOccurrence => + match declaration { + NamespaceSegmentOccurrence => OccurrenceCategoryBindingAdmissible + _ => OccurrenceCategoryBindingInadmissible { + reference: reference, + declaration: declaration, + } + } + } +} + type OccurrenceProjection { occurrence: OccurrenceId authored_name: String @@ -135,6 +210,7 @@ type OccurrenceTransportRefusal observed: OccurrenceCategory, diagnostic_span: SourceSpan, } + | UnknownOccurrenceIdentity { occurrence: OccurrenceId } data occurrence_identity_constructor_spelling_note: String = "NodeOccurrenceIdentity uses collision-free neutral constructors because .dag variant names are closure-global: the legacy v2 SyntheticOccurrence/MintedOccurrence facade and identically named shared constructors cannot coexist in one conversion closure. The constructor spelling is representation; this shared carrier and its allocator remain the semantic authority." @@ -207,6 +283,25 @@ fn occurrence_containment_paths_equal( left.terminal.value == right.terminal.value } +data occurrence_containment_path_query_note: String = "Canonical containment-path query (review 44814): occurrence_containment_path_is_prefix_of is the ONE surface for prefix tests over OccurrenceContainmentPath. It flattens ancestors++terminal and consumes std.types.is_prefix_of (review 45014 / review 45081) — never ancestor-membership alone (that admitted [A]→X as a prefix of [B,X]→Y).\n\nDELETED, NOT MOVED: occurrence_containment_path_contains_ancestor was the sibling ancestor-membership surface this row used to name. The review 45014 / 45081 correction is exactly what orphaned it — once prefix stopped consulting ancestor membership alone, nothing called it, and a corpus-wide check (dag, src/v2, src/v1) found zero consumers: its own declaration, this note, and its own generated emission. Deleting it completes that correction rather than leaving a dead second surface beside the one authority (review 45409, DESIGN section 5 dead-scaffold wall).\n\nWHY DELETED RATHER THAN ROUTED THROUGH A CANONICAL any: the review proposed folding it onto v2.std.algebra's any. That would be a section 3 inversion -- any exists ONLY in src/v2/std/algebra.dag, module v2.std.algebra, which is the v2 compiler's private copy of std; dag/std/algebra.dag, the std authority, has no any. Making std.occurrence_identity import v2.std.algebra would point the authority at a copy of itself. With zero consumers there is no surface to preserve, so deletion is both the smaller change and the correct one; if an ancestor-membership query is ever needed again it should arrive with its consumer, and any should be lifted into std.algebra first." + +fn occurrence_containment_path_id_sequence( + path: OccurrenceContainmentPath +) -> List { + path.ancestors |> list_push(path.terminal) +} + +fn occurrence_containment_path_is_prefix_of( + prefix: OccurrenceContainmentPath, + path: OccurrenceContainmentPath +) -> Bool { + is_prefix_of( + prefix: occurrence_containment_path_id_sequence(path: prefix), + xs: occurrence_containment_path_id_sequence(path: path), + eq: occurrence_id_eq, + ) +} + type OccurrenceTransportIndexBuild { entries_by_id: Map refusal: OccurrenceTransportRefusal? @@ -438,21 +533,34 @@ fn reference_occurrence_refusal( } } -fn occurrence_transport_refusal( +type ValidatedOccurrenceTransport { + entries_by_id: Map + references_by_id: Map + declarations: List + references: List +} + +type OccurrenceTransportValidation + = OccurrenceTransportValidated { transport: ValidatedOccurrenceTransport } + | OccurrenceTransportRefused { refusal: OccurrenceTransportRefusal } + +data occurrence_transport_validation_authority_note: String = "Canonical transport validity boundary (review 45043): occurrence_transport_validate builds each graph-local identity/category index exactly once and either refuses or yields ValidatedOccurrenceTransport whose entries_by_id and references_by_id are the indexed authorities. Resolvers consume the validated carrier — never rescan OccurrenceIndex.entries, and never rescan the declarations/references lists, per authored occurrence. occurrence_transport_refusal is the Option projection of the same validation. references_by_id is carried rather than rebuilt (review 45329): validation already builds it to decide declaration refusals, so dropping it from the carrier forced reference lookup to re-derive the same index by a linear filter over references — a second representation of a fact this boundary already owns, and the exact rescan the sentence above forbids. The declarations/references lists remain on the carrier because refusal folds consume them in order; they are not a lookup path." + +fn occurrence_transport_validate( transport: OccurrenceTransport -) -> OccurrenceTransportRefusal? { +) -> OccurrenceTransportValidation { let index_build = occurrence_transport_index_build( index: transport.index ) match index_build.refusal { - Present { value: refusal } => Present { value: refusal } + Present { value: refusal } => OccurrenceTransportRefused { refusal: refusal } Absent => let role_index_build = occurrence_transport_role_index_build( declarations: transport.declarations, references: transport.references ) match role_index_build.refusal { - Present { value: refusal } => Present { value: refusal } + Present { value: refusal } => OccurrenceTransportRefused { refusal: refusal } Absent => let declaration_refusal = fold( transport.declarations, @@ -468,9 +576,9 @@ fn occurrence_transport_refusal( } ) match declaration_refusal { - Present { value: refusal } => Present { value: refusal } + Present { value: refusal } => OccurrenceTransportRefused { refusal: refusal } Absent => - fold( + let reference_refusal = fold( transport.references, init: none, f: (refusal, reference) => @@ -483,7 +591,27 @@ fn occurrence_transport_refusal( ) } ) + match reference_refusal { + Present { value: refusal } => OccurrenceTransportRefused { refusal: refusal } + Absent => OccurrenceTransportValidated { + transport: ValidatedOccurrenceTransport { + entries_by_id: index_build.entries_by_id, + references_by_id: role_index_build.references_by_id, + declarations: transport.declarations, + references: transport.references, + }, + } + } } } } } + +fn occurrence_transport_refusal( + transport: OccurrenceTransport +) -> OccurrenceTransportRefusal? { + match occurrence_transport_validate(transport: transport) { + OccurrenceTransportRefused { refusal: refusal } => Present { value: refusal } + OccurrenceTransportValidated { transport: _ } => none + } +} diff --git a/dag/std/os.dag b/dag/std/os.dag index 3fe65a6fba1..406e3b626e8 100644 --- a/dag/std/os.dag +++ b/dag/std/os.dag @@ -1,5 +1,18 @@ module std.os - +import std.os.types { + Apfs, + Darwin, + Linux, + MacosDistributionCatalogRow, + Ntfs, + OperatingSystemSurface, + Posix, + PosixProcess, + UbuntuDistributionCatalogRow, + WindowsDistributionCatalogRow, + WindowsNt, + WindowsProcess, +} fn operating_system_surface_ubuntu(row: UbuntuDistributionCatalogRow) -> OperatingSystemSurface { OperatingSystemSurface { diff --git a/dag/std/os/invocation.dag b/dag/std/os/invocation.dag index cb818f0c0f3..a8f87d1e54c 100644 --- a/dag/std/os/invocation.dag +++ b/dag/std/os/invocation.dag @@ -1,5 +1,7 @@ module std.os.invocation +import std.types { NonEmptyStr, Int, List } +import std.abi { CallingConvention } type SyscallEntry { number: Int diff --git a/dag/std/syllogism.dag b/dag/std/syllogism.dag index 56de634c64a..c9684b5439e 100644 --- a/dag/std/syllogism.dag +++ b/dag/std/syllogism.dag @@ -1,5 +1,12 @@ module std.syllogism - +import std.graph { + GraphEdge, + CallGraph, + DfsFinishAcc, + build_adjacency_views, + dfs_finish_order, + graph_has_multi_node_scc, +} type AxiomKind = LogicalAxiom | NonLogicalAxiom diff --git a/dag/std/types.dag b/dag/std/types.dag index 2e282089ae2..01760eb26f4 100644 --- a/dag/std/types.dag +++ b/dag/std/types.dag @@ -107,6 +107,27 @@ type List = FreeMonoid type Set = PointwisePower type Map = PartialFunction +data free_monoid_prefix_query_note: String = "Canonical FreeMonoid/List prefix query (DESIGN §2/§3): is_prefix_of is the single prefix walker over List (= FreeMonoid). Domain surfaces consume this — they do not re-walk Empty|Cons. Parameterized as List so stage0 Clone bounds fire via container_type_arity; FreeMonoid itself stays out of that map (enrolling it treated String=FreeMonoid as a container and broke Edge/String inference)." + +fn is_prefix_of( + prefix: List, + xs: List, + eq: fn(T, T) -> Bool +) -> Bool { + match prefix.first() { + Absent => true + Present { value: h_prefix } => match xs.first() { + Absent => false + Present { value: h_xs } => + eq(h_prefix, h_xs) && is_prefix_of( + prefix: prefix.skip(n: 1), + xs: xs.skip(n: 1), + eq: eq, + ) + } + } +} + fn list_length(items: List) -> Int { fold(items, init: 0, f: (acc, _) => acc + 1) } diff --git a/dag/test/claim/accelerator_demo_gpu_witness_test.dag b/dag/test/claim/accelerator_demo_gpu_witness_test.dag index cb1dcd12b78..a582ec9af78 100644 --- a/dag/test/claim/accelerator_demo_gpu_witness_test.dag +++ b/dag/test/claim/accelerator_demo_gpu_witness_test.dag @@ -1,5 +1,43 @@ module test.claim.accelerator_demo_gpu_witness - +import gunbc.accelerator_demo_gpu { + witness_m5_gpu_execution_lane_count_grounded, + witness_rtx5090_execution_lane_count_grounded, + witness_rtx5090_memory_bandwidth_grounded, + witness_m5_memory_bandwidth_grounded, + witness_rtx5090_compute_capability_grounded, + witness_m5_has_no_compute_capability, + witness_integer_path_is_lossless, + witness_float_path_is_lossy_even_when_fma_refused, + witness_gpu_receipt_status_is_dormant, + witness_gpu_triptych_contains_three_panels, +} +import extdeps.languages.gpu.wgsl.kernel { + witness_wgsl_relu_mul_add_kernel_surface_shape, + witness_wgsl_reuses_simd_op_code_authority, + witness_wgsl_int_kernel_source_shape, + witness_wgsl_float_kernel_source_shape, + witness_wgsl_kernel_sources_grammar_scaffold_documented, +} +import extdeps.gpu.types { + Metal, + Cuda, + Rocm, + OpenCl, +} +import extdeps.gpu.apple { apple_m5_gpu_catalog } +import extdeps.gpu.nvidia { nvidia_rtx_5090_catalog } +import extdeps.vendor.apple { apple } +import extdeps.vendor.nvidia { nvidia } +import extdeps.memory.types { + UnifiedShared, + Dram, + Hbm, +} +import std.types { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: v2.std.live_tree.LiveTreeDisposition = v2.std.live_tree.SubstrateInputsOnly diff --git a/dag/test/claim/access_validation_test.dag b/dag/test/claim/access_validation_test.dag index 478cb5ebd32..14f6fa62a9c 100644 --- a/dag/test/claim/access_validation_test.dag +++ b/dag/test/claim/access_validation_test.dag @@ -1,5 +1,28 @@ module test.claim.access_validation - +import std.types { + NonEmptyStr, + Bool, + Int, +} +import std.access { + AccessRequest, + AccessDecision, + Permit, + Deny, + AccessPolicy, +} +import extdeps.access.posix { + FilePermissions, + PermissionBits, +} +import extdeps.access.rbac { + RbacPolicy, + Permission, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/base64_rfc4648_witness_test.dag b/dag/test/claim/base64_rfc4648_witness_test.dag index 24c1720482e..f436b5da0cd 100644 --- a/dag/test/claim/base64_rfc4648_witness_test.dag +++ b/dag/test/claim/base64_rfc4648_witness_test.dag @@ -1,5 +1,23 @@ module test.claim.base64_rfc4648_witness - +import std.bit { Bool } +import std.integer { UInt8 } +import std.bytes { + bytes_octets, + octets_bytes, + utf8_encode_bytes, +} +import std.encoding { + Base64Variant, + Standard, + UrlSafe, + base64_encode, + base64_decode, + utf8_decode_bytes, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_auth_runtime_secret_seam_test.dag b/dag/test/claim/bmc_auth_runtime_secret_seam_test.dag index fd0d4b5fdc9..1be0217a24d 100644 --- a/dag/test/claim/bmc_auth_runtime_secret_seam_test.dag +++ b/dag/test/claim/bmc_auth_runtime_secret_seam_test.dag @@ -1,5 +1,13 @@ module test.claim.bmc_auth_runtime_secret_seam - +import std.bit { Bool } +import std.types { Secret } +import std.bytes { utf8_encode_bytes } +import extdeps.bmc.openbmc { openbmc_factory_login } +import extdeps.cloud.gcp.secret_manager { utf8_secret_from_access_payload } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_bootstrap_provision_witness_test.dag b/dag/test/claim/bmc_bootstrap_provision_witness_test.dag index c34125d7de9..6671b448810 100644 --- a/dag/test/claim/bmc_bootstrap_provision_witness_test.dag +++ b/dag/test/claim/bmc_bootstrap_provision_witness_test.dag @@ -1,5 +1,28 @@ module test.claim.bmc_bootstrap_provision_witness - +import std.bit { Bool } +import std.types { String } +import extdeps.cloud.gcp.iam { + GcpBinding, + role_secretmanager_secret_accessor, + role_secretmanager_secret_version_adder, +} +import gunbc.assimilate.bmc_token_federation { + bmc_assimilator_sa_member, + bmc_role_allowed, +} +import extdeps.cloud.gcp.gcp { + GcpService, + gcp_service_api_id, +} +import gunbc.assimilate.bmc_bootstrap_provision { + bmc_secret_iam_bindings, + bmc_required_gcp_apis, + bmc_assimilate_service_deps, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_factory_credential_witness_test.dag b/dag/test/claim/bmc_factory_credential_witness_test.dag index 381f1763c0b..61856322646 100644 --- a/dag/test/claim/bmc_factory_credential_witness_test.dag +++ b/dag/test/claim/bmc_factory_credential_witness_test.dag @@ -1,5 +1,29 @@ module test.claim.bmc_factory_credential - +import std.bit { Bool } +import std.types { + Int, + List, +} +import std.bmc { + BmcProtocol, + BmcEndpoint, + Redfish, + OpenBmc, +} +import extdeps.boards.types { + ServerBaseboard, + AsrockRackAltrad8ud1l2t, +} +import std.credentials { FactoryLogin } +import extdeps.boards.asrock_rack { asrock_altrad8ud_1l2t_catalog } +import extdeps.bmc.openbmc { + bmc_firmware_factory_login, + bmc_firmware_supported_protocols, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_onboard_body_witness_test.dag b/dag/test/claim/bmc_onboard_body_witness_test.dag index 60abff6f59c..cc828a228a6 100644 --- a/dag/test/claim/bmc_onboard_body_witness_test.dag +++ b/dag/test/claim/bmc_onboard_body_witness_test.dag @@ -1,5 +1,16 @@ module test.claim.bmc_onboard_body_witness - +import std.bit { Bool } +import gunbc.tools.bmc_onboard { + netrc_content, + account_password_body, + boot_override_body, + reset_body, + gcp_secret_full_name, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_onboarding_lifecycle_witness_test.dag b/dag/test/claim/bmc_onboarding_lifecycle_witness_test.dag index 4e95054482b..8f576923854 100644 --- a/dag/test/claim/bmc_onboarding_lifecycle_witness_test.dag +++ b/dag/test/claim/bmc_onboarding_lifecycle_witness_test.dag @@ -1,5 +1,60 @@ module test.claim.bmc_onboarding_lifecycle - +import std.bit { Bool } +import std.types { Int } +import std.credentials { + Stored, + Chained, +} +import std.os.types { + UbuntuOs, + WindowsOs, + MacosOs, + NobleNumbat2404Lts, +} +import gunbc.bmc_onboarding { + BmcOnboardingPhase, + CredentialsRotated, + OsInstalled, + FabricJoined, + BmcCredentialPosture, + RotatedSecretManaged, + KeylessFederated, + bmc_onboarding_next_phase, + bmc_onboarding_prev_phase, + BmcLifecycleState, + BmcRecoverableInvariant, + bmc_recoverable_quotient, + bmc_onboard_to_steady, + bmc_decom_to_factory, + bmc_factory_state, + bmc_install_step, + bmc_transition_roundtrips_on_quotient, + bmc_full_state_is_lossy_after_roundtrip, + bmc_phase_credential_posture, + bmc_lifecycle_is_monotone_hardening, + bmc_lifecycle_length, + bmc_plan_steady_state_phase, + bmc_plan_steady_state_posture, + BmcCredentialProbeResult, + FactoryCredentialActive, + RotatedCredentialActive, + CredentialStateUnknown, + bmc_credential_probe_to_phase, +} +import extdeps.bmc.types { + BootTargetCd, + redfish_boot_target_wire, + redfish_account_role_wire, +} +import gunbc.assimilate.bmc_token_federation { emit_bmc_token_smoke_workflow_yaml } +import extdeps.communication.medium { + Lossless, + Lossy, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_redfish_grounding_witness_test.dag b/dag/test/claim/bmc_redfish_grounding_witness_test.dag index 9a56a13ead9..6e90d921b47 100644 --- a/dag/test/claim/bmc_redfish_grounding_witness_test.dag +++ b/dag/test/claim/bmc_redfish_grounding_witness_test.dag @@ -1,5 +1,37 @@ module test.claim.bmc_redfish_grounding - +import std.bit { Bool } +import std.measure { + byte_size_count, + watt, + watt_count, + hardware_thread_count, + hardware_thread_count_value, + gibibyte, + gibibyte_to_byte_size, + memory_scale_factor_bytes, + Mega, + Gibi, + gibibyte_scale_factor_bytes, +} +import extdeps.bmc.types { + BmcTelemetrySnapshot, + RedfishChassisSensorCollection, + RedfishPowerControl, + RedfishPowerSubsystem, + RedfishSensorReading, + RedfishSystemInventory, + On, +} +import extdeps.bmc.redfish { + bmc_ground_host_observations, + redfish_system_inventory, +} +import extdeps.bmc { bmc_ground_snapshot } +import extdeps.boards.asrock_rack { asrock_altrad8ud_redfish_chassis_id } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_token_federation_witness_test.dag b/dag/test/claim/bmc_token_federation_witness_test.dag index 124e3a3e30d..e5a7fd3309d 100644 --- a/dag/test/claim/bmc_token_federation_witness_test.dag +++ b/dag/test/claim/bmc_token_federation_witness_test.dag @@ -1,5 +1,26 @@ module test.claim.bmc_token_federation_witness - +import std.bit { Bool } +import gunbc.assimilate.bmc_token_federation { + SecretAccessBinding, + bmc_assimilator_bindings, + bmc_assimilator_sa_member, + bmc_srv3_secret_name, + bmc_secrets_project_id, + bmc_assimilator_allowed_roles, + bmc_role_allowed, + bmc_wif_provider_resource, + bmc_wif_principal_set, + bmc_wif_attribute_condition, + emit_bmc_token_smoke_workflow_yaml, +} +import extdeps.cloud.gcp.iam { + role_secretmanager_secret_accessor, + role_secretmanager_secret_version_adder, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/bmc_wif_delegation_chain_witness_test.dag b/dag/test/claim/bmc_wif_delegation_chain_witness_test.dag index f3200806b4b..bd36e425288 100644 --- a/dag/test/claim/bmc_wif_delegation_chain_witness_test.dag +++ b/dag/test/claim/bmc_wif_delegation_chain_witness_test.dag @@ -1,5 +1,51 @@ module test.claim.bmc_wif_delegation_chain_witness - +import std.bit { Bool } +import std.types { + List, + String, +} +import gunbc.ci_workflow { ci_workflow } +import gunbc.assimilate.bmc_token_federation { + bmc_wif_attribute_condition, + bmc_assimilator_sa_email, + bmc_role_allowed, + bmc_token_smoke_workflow, + bmc_token_smoke_job, +} +import gunbc.assimilate.bmc_wif_delegation_chain { + CredentialDelegationStep, + GhaOidcIssuance, + WifTokenExchange, + ServiceAccountImpersonation, + SecretVersionAccess, + bmc_wif_canary_delegation_chain, + bmc_wif_signed_grants, + bmc_wif_bootstrap_bindings, + bmc_wif_canary_grant, + bmc_srv3_admin_access_grant, + wif_canary_secret_ref, + bmc_srv3_admin_secret_ref, + srv3_credential_path_options, + OperatorOneHourToken, + ActorPinnedWorkflowDispatch, + DedicatedActuatorIdentity, + ExistingAssimilatorSaBinding, + bmc_srv3_admin_legacy_binding, + bound_secret_read_capabilities, +} +import gunbc.auth.secret_access_grant { + grant_is_signed, + grant_is_legacy, +} +import gunbc.auth.secret_ref_credential { secret_ref_credential_authority } +import extdeps.cloud.gcp.secret_ref { + secret_ref_secret_resource, + secret_ref_hash_known, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/budget_tree_witness_test.dag b/dag/test/claim/budget_tree_witness_test.dag index fcffc965318..b5a55b423b0 100644 --- a/dag/test/claim/budget_tree_witness_test.dag +++ b/dag/test/claim/budget_tree_witness_test.dag @@ -1,4 +1,44 @@ module test.claim.budget_tree_witness +import std.bit { Bool } +import std.nat { Nat } +import std.measure { + byte_size, + Memory, + One, +} +import extdeps.accounting.budget { + Appropriation, + LineItem, + BudgetBalance, + Surplus, + Balanced, + Deficit, + BudgetingMethod, + ZeroBased, + within_appropriation, + admit_all, + AdmissionState, +} +import product.budget_tree { + BudgetNode, + BudgetClaim, + BudgetPriority, + Guaranteed, + BestEffort, + BudgetReconciliation, + Evicted, + GuaranteedShortfall, + node_conserves, + node_conserves_local, + node_balance, + reconcile, + claim_items, + budget_tree_method, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/builtin_get_resolver_test.dag b/dag/test/claim/builtin_get_resolver_test.dag index 2b550354b02..3b4642c00ae 100644 --- a/dag/test/claim/builtin_get_resolver_test.dag +++ b/dag/test/claim/builtin_get_resolver_test.dag @@ -1,4 +1,8 @@ module test.claim.builtin_get_resolver +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cache_key_completeness_test.dag b/dag/test/claim/cache_key_completeness_test.dag index 4342dd3facb..201d20fcbc7 100644 --- a/dag/test/claim/cache_key_completeness_test.dag +++ b/dag/test/claim/cache_key_completeness_test.dag @@ -1,4 +1,36 @@ module test.claim.cache_key_completeness +import extdeps.cache.key_completeness { + cache_key_derivation_complete, + cache_catalog_key_completeness_holds, +} +import v2.extdeps.cache.key_completeness_verdict { cache_key_completeness_verdict } +import extdeps.cache.types { + CatalogKeyDerivationFacts, + NativeInternal, + HandAuthored, + content_addressed_inputs, + catalog_inputs_considered, + catalog_has_vendor_only_key_inputs, + RustcInvocation, + ToolchainSpec, + UpsertSubject, +} +import extdeps.cache { cache_catalog } +import extdeps.realization.resolved_graph { resolved_graph_cache_facts } +import std.cache_interface { + ToolchainChange, + ManualPurge, + Org, +} +import v2.std.lens_verdict { + Holds, + Violation, +} +import std.types { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cache_layer_planner_test.dag b/dag/test/claim/cache_layer_planner_test.dag index a6edb63eb5a..2bf3bb122d1 100644 --- a/dag/test/claim/cache_layer_planner_test.dag +++ b/dag/test/claim/cache_layer_planner_test.dag @@ -1,4 +1,35 @@ module test.claim.cache_layer_planner +import std.types { Bool } +import std.verification { nanosecond_duration } +import std.realization_schedule { + CostAccount, + cost_account_measured, +} +import std.cache_interface { + CacheDeploymentBackends, + cache_layer_plan_contains_id, + cache_layer_plan_fallback, + cache_layer_plan_primary, + cache_layer_plan_respects_locality_order, + plan_cache_layers, + NativeInternalEncoding, +} +import extdeps.cache.buildbuddy { buildbuddy_cas_id } +import extdeps.cache { + cache_catalog_rows, + cache_layer_default_order, + sccache_local_projected, + parse_table_memo_projected, + cargo_target_dir_projected, +} +import extdeps.cache.github_actions { gha_actions_cache_id } +import extdeps.cache.rustup { rustup_toolchain_store_id } +import extdeps.cache.sccache { sccache_local_id } +import extdeps.realization.parse_table_memo { parse_table_memo_id } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cache_purity_verdict_test.dag b/dag/test/claim/cache_purity_verdict_test.dag index 18451d7b9a3..96567a3578e 100644 --- a/dag/test/claim/cache_purity_verdict_test.dag +++ b/dag/test/claim/cache_purity_verdict_test.dag @@ -1,4 +1,15 @@ module test.claim.cache_purity_verdict +import extdeps.realization.cache_purity { + CachePurityViolation, + Pure, + Impure, + cache_purity_verdict, +} +import std.types { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/card_intake_risk_witness_test.dag b/dag/test/claim/card_intake_risk_witness_test.dag index 3c5dc88e8ea..0c2f3921af5 100644 --- a/dag/test/claim/card_intake_risk_witness_test.dag +++ b/dag/test/claim/card_intake_risk_witness_test.dag @@ -1,5 +1,30 @@ module test.claim.card_intake_risk_witness - +import extdeps.tcgplayer.catalog { + CardCondition, + NearMint, + card_condition_display_name, + parse_card_condition, +} +import gunbc.tools.card_intake { + CatalogMatch, + ExactMatch, + AmbiguousMatch, + NoMatch, + RiskReason, + UnmatchedCard, + AmbiguousCatalogMatch, + UnpricedCard, + HighValue, + IntakeDisposition, + ReadyToList, + NeedsReview, + classify_catalog_match, + assess_intake, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cargo_target_path_witness_test.dag b/dag/test/claim/cargo_target_path_witness_test.dag index ff72316a4f4..d4c74d55205 100644 --- a/dag/test/claim/cargo_target_path_witness_test.dag +++ b/dag/test/claim/cargo_target_path_witness_test.dag @@ -1,4 +1,31 @@ module test.claim.cargo_target_path +import std.bit { Bool } +import std.types { + String, + List, + FilePathParts, +} +import extdeps.cargo { + CargoTarget, + Lib, + Bin, + CargoTest, + Example, + Bench, + cargo_target_source_path, + rust_module_candidate_paths, + RustEdition, + Edition2015, + Edition2018, + Edition2021, + Edition2024, + rust_edition_str, + default_rust_edition, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cargo_version_witness_test.dag b/dag/test/claim/cargo_version_witness_test.dag index 3477b26f97e..1b72f76d4e3 100644 --- a/dag/test/claim/cargo_version_witness_test.dag +++ b/dag/test/claim/cargo_version_witness_test.dag @@ -1,4 +1,23 @@ module test.claim.cargo_version +import extdeps.cargo { + CargoPackage, + CargoDependency, + RegistryDep, + Edition2021, + min_cargo_version, +} +import extdeps.cargo_version { + CargoVersionRequirement, + CargoToolVersionFloor, + default_stage0_package_version, + render_cargo_package_version_field, + render_cargo_package_header_prefix, + render_cargo_version_requirement_toml, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_budget_tree_witness_test.dag b/dag/test/claim/ci_budget_tree_witness_test.dag index 980b0307f1a..66199071178 100644 --- a/dag/test/claim/ci_budget_tree_witness_test.dag +++ b/dag/test/claim/ci_budget_tree_witness_test.dag @@ -1,4 +1,50 @@ module test.claim.ci_budget_tree_witness +import std.bit { Bool } +import std.measure { + byte_size, + byte_size_count, +} +import product.budget_tree { + node_conserves, + budget_child_named, + BudgetChildMissing, +} +import gunbc.ci_fleet { + srv1_offer, + srv2_offer, + srv3_offer, +} +import gunbc.ci_runner_target { + FleetSelfHosted, + ci_runner_target_ram_speed_budget, +} +import gunbc.ci_budget_tree { + srv1_budget_tree, + srv2_budget_tree, + srv3_budget_tree, + srv1_host_ram, + srv1_fixed_overhead_bytes, + srv1_gha_runner_pool_budget, + srv1_dashboard_session_pool_budget, + srv1_floor_memory_budget, + srv1_ci_run_container_hard_cap, + host_allocatable_bytes, + host_budget_tree_at, + budget_tree_gha_runner_pool_node, + budget_tree_dashboard_session_pool_node, + witness_floor_budget_equals_selected_target_budget, +} +import gunbc.fleet_host_budget { gunbc_per_runner_memory_cap } +import gunbc.ci_floor_measurement { + gunbc_ci_runner_cgroup_memory_cap, + gunbc_ci_runner_slot_memory_max_live, + gunbc_ci_dashboard_session_container_cap, + witness_runner_cgroup_cap_lt_dashboard_session_cap, +} +import v2.std.live_tree { + LiveTreeDisposition, + ReadsLiveTree, +} data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree diff --git a/dag/test/claim/ci_deploy_observed_wet_test.dag b/dag/test/claim/ci_deploy_observed_wet_test.dag index 2c921815da7..d194d821f79 100644 --- a/dag/test/claim/ci_deploy_observed_wet_test.dag +++ b/dag/test/claim/ci_deploy_observed_wet_test.dag @@ -1,5 +1,19 @@ module test.claim.ci_deploy_observed_wet - +import std.bit { Bool } +import gunbc.ci_deploy_access { + ci_deploy_srv1_access, + deploy_access_refusal_prefix, + deploy_access_preflight_pass_message, + deploy_access_decision_reason, +} +import gunbc.host_effect_realize { deploy_access_check_observed } +import std.access { Permit } +import extdeps.access.aws_iam { Deny } +import gunbc.fleet_posix_accounts { + FleetAccountCiRunner, + fleet_posix_principal, + grounded_posix_principal_name, +} data ci_deploy_observed_wet_note: String = "OFFLINE wet integration witness (hermetic-floor split, operator posture 2026-07-11: integration-style witnesses do not run regularly; CI runs hermetic/mocked variants). deploy_access_check_observed shells live whoami + sudo -n, so this half of test.claim.ci_deploy_witness moved here when the discovery corpus flipped Hermetic; the pure half (script pins, enrollment pins, and the mock-shaped deploy_access_check(access, actor) dual) stays discovered. Local recipe: claim_batch --wet --source-root dag --source-root src/v2 --entry dag/test/claim/ci_deploy_observed_wet_test.dag. Dissolve-on: the scheduled (nightly) lane un-darkens and admits wet integration rows under its own budget — then enroll this entry there as a declared execution row." diff --git a/dag/test/claim/ci_deploy_target_host_witness_test.dag b/dag/test/claim/ci_deploy_target_host_witness_test.dag index 150cabe2cfe..d8f28d81a23 100644 --- a/dag/test/claim/ci_deploy_target_host_witness_test.dag +++ b/dag/test/claim/ci_deploy_target_host_witness_test.dag @@ -1,4 +1,42 @@ module test.claim.ci_deploy_target_host_witness +import gunbc.ci_deploy_access { + ci_deploy_srv1_access, + deploy_target_proof_from_access, + deploy_access_with_ssh_transport, + deploy_target_host_preflight_script, +} +import std.types { + Bool, + List, + String, +} +import gunbc.ci_deploy_target_host { + RunnerIdentityOnHost, + deploy_target_host_apply_permitted, + deploy_local_apply_refused_for_observed_host, + deploy_target_ssh_proof_structurally_valid, + gunbc_ci_deploy_srv1_runner_spec, + deploy_target_host_refusal_local, +} +import gunbc.ci_spec { + gunbc_ci_deploy_srv1_stage, + gunbc_ci_deploy_stages, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import gunbc.fleet_intent { srv1_host } +import gunbc.host_effect { SshShell } +import gunbc.ci_yaml_emit { expected_ci_yml } +import extdeps.github.actions { + SelfHosted, + RunsOnExpression, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_exclusion_proof_test.dag b/dag/test/claim/ci_exclusion_proof_test.dag index 0e5db4f5a93..30167e9e50e 100644 --- a/dag/test/claim/ci_exclusion_proof_test.dag +++ b/dag/test/claim/ci_exclusion_proof_test.dag @@ -1,5 +1,9 @@ module test.claim.ci_exclusion_proof - +import std.types { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_failure_class_witness_test.dag b/dag/test/claim/ci_failure_class_witness_test.dag index 66ec6163439..332f623569c 100644 --- a/dag/test/claim/ci_failure_class_witness_test.dag +++ b/dag/test/claim/ci_failure_class_witness_test.dag @@ -1,4 +1,38 @@ module test.claim.ci_failure_class_witness +import std.process { + ProcessExit, + ExitSuccess, + ExitFailure, +} +import gunbc.ci_failure_class { + InfraSignature, + RunnerLost, + FloorFailureClass, + Infra, + Structural, + FloorOutcome, + NoFailure, + FloorFailed, + classify_failure_reason, + classify_floor_exit, + floor_failure_blocks_merge, + floor_outcome_blocks_merge, + floor_exit_blocks_merge, + infra_retry_grep_alternation, + build_retry_infra_signatures, + verdict_infra_signatures, + infra_signature_match_substring, + infra_signature_origin, + MergeGatingStatus, + GatingComputedDeferred, + merge_freshness_gating_status, + gating_is_enforced, + merge_freshness_verdict_is_consumed_to_block, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_oom_reclassify_witness_test.dag b/dag/test/claim/ci_oom_reclassify_witness_test.dag index 92c0b789928..b99e0a4f2af 100644 --- a/dag/test/claim/ci_oom_reclassify_witness_test.dag +++ b/dag/test/claim/ci_oom_reclassify_witness_test.dag @@ -1,4 +1,46 @@ module test.claim.ci_oom_reclassify_witness +import std.process { + ProcessExit, + ExitFailure, +} +import gunbc.ci_failure_class { + FloorOutcome, + NoFailure, + FloorFailed, + FloorFailureClass, + Infra, + Structural, + ClusteredOutOfMemoryKill, + classify_floor_exit, + floor_outcome_blocks_merge, +} +import gunbc.ci_oom_reclassify { + OomKillSource, + CgroupMemoryEvents, + SystemdOomdJournal, + OomKillObservation, + OomKillConfirmed, + NoOomKillObserved, + ClusteringSignal, + SimultaneousMultiJobDeath, + HostBootIdReset, + ClusteringEvidence, + Clustered, + NotClustered, + oom_kill_from_cgroup_counter, + oom_kill_from_oomd_journal, + observe_oom_kill, + oom_is_confirmed, + host_boot_id_reset, + clustering_signal_from_boot_id, + clustering_is_present, + reclassify_floor_failure, + reclassify_floor_outcome, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_render_histogram_width_test.dag b/dag/test/claim/ci_render_histogram_width_test.dag index 2d1b263272e..b9ea6ae7d0c 100644 --- a/dag/test/claim/ci_render_histogram_width_test.dag +++ b/dag/test/claim/ci_render_histogram_width_test.dag @@ -1,7 +1,11 @@ module test.claim.ci_render_histogram_width - -import gunbc.ci_render { timing_histogram_frame, render_percentile_box, percentiles_box_frame_ns } +import gunbc.ci_render { + percentiles_box_frame_ns, + render_percentile_box, + timing_histogram_frame, +} import extdeps.unicode.display { string_display_width } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_render_slowest_hot_style_test.dag b/dag/test/claim/ci_render_slowest_hot_style_test.dag index 1b65666e31e..bef6f1cff3b 100644 --- a/dag/test/claim/ci_render_slowest_hot_style_test.dag +++ b/dag/test/claim/ci_render_slowest_hot_style_test.dag @@ -1,6 +1,10 @@ module test.claim.ci_render_slowest_hot_style - -import gunbc.ci_render { slowest_witness_row, render_slowest_witnesses_box, render_slowest_witnesses_box_default } +import gunbc.ci_render { + render_slowest_witnesses_box, + render_slowest_witnesses_box_default, + slowest_witness_row, +} +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_runner_seam_witness_test.dag b/dag/test/claim/ci_runner_seam_witness_test.dag index 1b906253732..e9c0a46cf0b 100644 --- a/dag/test/claim/ci_runner_seam_witness_test.dag +++ b/dag/test/claim/ci_runner_seam_witness_test.dag @@ -1,4 +1,17 @@ module test.claim.ci_runner_seam_witness +import gunbc.ci_fleet { gunbc_ci_fleet_offer } +import gunbc.ci_runner_target { gunbc_ci_selected_runner_spec } +import gunbc.runner_spec_from_offer { + runner_spec_from_offer, + gunbc_ci_runner_spec, +} +import gunbc.ci_workflow { ci_workflow } +import gunbc.ci_yaml_emit { expected_ci_yml } +import extdeps.github.actions { SelfHosted } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ci_runner_target_witness_test.dag b/dag/test/claim/ci_runner_target_witness_test.dag index 55e5323bae5..43a98f4377b 100644 --- a/dag/test/claim/ci_runner_target_witness_test.dag +++ b/dag/test/claim/ci_runner_target_witness_test.dag @@ -1,4 +1,44 @@ module test.claim.ci_runner_target_witness +import extdeps.cloud.ubicloud { + UbicloudRunnerCatalogRow, + ubicloud_runner_catalog, + ubicloud_standard_16_arm_catalog, +} +import extdeps.github.actions { + RunnerSpec, + SelfHosted, + HostedRunner, +} +import extdeps.github.hosted_runners { + PrivateRepo, + github_hosted_ubuntu_2404_arm_private_catalog, + github_hosted_ubuntu_2404_arm_public_catalog, +} +import extdeps.languages.yaml.gha_workflow { + runner_yaml, + runner_label_string, + string_list_flow, +} +import extdeps.languages.yaml.types { yaml_string } +import gunbc.ci_runner_target { + CiRunnerTarget, + FleetSelfHosted, + UbicloudRunner, + GithubHostedRunner, + RunnerMemoryRegime, + SlotCarved, + WholeMachine, + ci_runner_target_spec, + ci_runner_target_memory_regime, + selected_ci_runner_target, + gunbc_ci_selected_runner_spec, +} +import gunbc.runner_spec_from_offer { gunbc_ci_runner_spec } +import std.measure { + byte_size, + byte_size_count, + hardware_thread_count_value, +} test fn witness_fleet_target_projects_fleet_derivation() -> Bool { ci_runner_target_spec(target: FleetSelfHosted) == gunbc_ci_runner_spec() diff --git a/dag/test/claim/ci_yaml_parse_witness.dag b/dag/test/claim/ci_yaml_parse_witness.dag index a0c74d79b81..bc343c947d1 100644 --- a/dag/test/claim/ci_yaml_parse_witness.dag +++ b/dag/test/claim/ci_yaml_parse_witness.dag @@ -1,5 +1,15 @@ module test.claim.ci_yaml_parse_witness - +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import v2.extdeps.file_system { Filesystem } +import gunbc.ci_yaml_emit { + expected_ci_yml, + ci_yml_drifted, +} +import gunbc.ci_yaml_validate { ci_yml_parses } data ci_yml_path: String = ".github/workflows/ci.yml" data expected_parse_scratch: String = "/tmp/gunbc_ci_yml_expected_parse.yml" diff --git a/dag/test/claim/ci_yaml_serializer_witness_test.dag b/dag/test/claim/ci_yaml_serializer_witness_test.dag index db55ab03458..e7cd2feab00 100644 --- a/dag/test/claim/ci_yaml_serializer_witness_test.dag +++ b/dag/test/claim/ci_yaml_serializer_witness_test.dag @@ -1,4 +1,62 @@ module test.claim.ci_yaml_serializer_witness +import extdeps.languages.yaml.types { + YamlValue, + YamlKeyValue, + YamlString, + YamlInt, + YamlMapping, + YamlSequence, + yaml_string, + yaml_int, + yaml_bool, + yaml_mapping, + yaml_sequence, + kv, + empty_yaml_values, +} +import extdeps.languages.yaml.emit { serialize_yaml } +import extdeps.languages.yaml.gha_workflow { + project_workflow_to_yaml, + steps_yaml, + jobs_yaml, + step_yaml, +} +import gunbc.ci_yaml_emit { + expected_ci_yml, + ci_yml_drifted, +} +import gunbc.ci_workflow { + ci_workflow, + ci_cargo_build_jobs_count, +} +import gunbc.ci_workflow_expressions { + ci_workflow_expression_templates, + ci_cache_path_template, +} +import extdeps.github.actions { + RunStep, + UsesStep, +} +import extdeps.github.expressions { + ExpressionTemplate, + TemplateSegment, + LiteralText, + Interpolation, + ContextAccess, + Env, + Runner, + any_template_accesses_runner_var_via_env, + template_uses_context, +} +import gunbc.ci_spec { + gunbc_ci_spec, + gunbc_ci_floor_run, +} +import v2.workflow.ci_release_build_emit { ci_release_build_script } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cli_run_workspace_root_hand_rust_witness_test.dag b/dag/test/claim/cli_run_workspace_root_hand_rust_witness_test.dag index 9d89d8367cc..eb041e49b8f 100644 --- a/dag/test/claim/cli_run_workspace_root_hand_rust_witness_test.dag +++ b/dag/test/claim/cli_run_workspace_root_hand_rust_witness_test.dag @@ -1,5 +1,22 @@ module test.claim.cli_run_workspace_root_hand_rust_witness - +import gunbc.cli_run_workspace_root_scaffold { + cli_run_workspace_root_discovery_scaffold, + cli_run_workspace_root_discovery_dissolve_trigger, + cli_run_workspace_root_hand_rust_receipt_plan_anchor, + cli_run_workspace_root_discovery_loc_delta_net, + cli_run_workspace_root_discovery_test_discriminator_git_toplevel, + cli_run_workspace_root_discovery_test_discriminator_cwd_ascent, + cli_run_source_root_anchor_scaffold, + cli_run_source_root_anchor_dissolve_trigger, + cli_run_source_root_anchor_receipt_plan_anchor, + cli_run_source_root_anchor_loc_delta_net, + cli_run_source_root_anchor_test_discriminator_present_root, + cli_run_source_root_anchor_test_discriminator_absent_root, +} +import std.disposition { + Scaffold, + SingleAuthority, +} test fn workspace_root_hand_rust_scaffold_is_seed_retained() -> Bool { match cli_run_workspace_root_discovery_scaffold { diff --git a/dag/test/claim/code_change_workflow_witness_test.dag b/dag/test/claim/code_change_workflow_witness_test.dag index d56c27e8e6e..97d79be915a 100644 --- a/dag/test/claim/code_change_workflow_witness_test.dag +++ b/dag/test/claim/code_change_workflow_witness_test.dag @@ -1,5 +1,63 @@ module test.claim.code_change_workflow_witness_test - +import gunbc.code_change_workflow { + CodeChangeFacts, + CodeChangeStage, + CodeChangeActiveStage, + CodeChangeTerminalStage, + CodeChangeBinding, + CodeChangeTransitionRequest, + CodeChangeGithubPrContext, + CodeChangeEventTag, + MarkReadyForReview, + RecordMergeReady, + ChangeOpen, + ChangeUnderReview, + ChangeMergeReady, + ChangeMerged, + ChangeClosed, + CodeChangeActive, + CodeChangeTerminal, + ChangeDraftBlocksReview, + CodeChangeDigestNotReady, + CodeChangePolicyNotPermitted, + CodeChangeMissingReviewTally, + CodeChangeMissingDigestVerdict, + CodeChangeHeadShaMismatch, + CodeChangeTallyRequestChanges, + CodeChangeTallyBlockingFindings, + CodeChangeNotMergeableClean, + CodeChangeAlreadyTerminal, + CanTransition, + TransitionRefused, + decide_code_change_transition, + classify_github_pr_terminal_anchor, +} +import gunbc.pr_digests { + Ready, + NotReady, +} +import gunbc.review_verdict { MergeReadinessTally } +import gunbc.process_algebra { ProcessNodeId } +import extdeps.github.pulls { + PullRequest, + PullRequestRef, + PullRequestState, + Open, + Closed, +} +import extdeps.github.github { + GitHubUser, + User, +} +import std.types { + CommitSha, + NonEmptyStr, + Timestamp, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/compile_source_model_witness_test.dag b/dag/test/claim/compile_source_model_witness_test.dag index d289839f530..9a813b13be8 100644 --- a/dag/test/claim/compile_source_model_witness_test.dag +++ b/dag/test/claim/compile_source_model_witness_test.dag @@ -1,4 +1,22 @@ module test.claim.compile_source_model_witness +import gunbc.compile_source_model { + SourceRootRole, + StrictPoolIndex, + PrimaryPrecedencePoolIndex, + EntrySourceRoot, + DependencyPoolRoot, + dependency_pool_index_from_flag, + source_root_role, + pool_fill_only_for_role, + compile_entry_source_root_index, + skip_pool_module_when_indexed, + duplicate_module_path_across_index_is_error, + duplicate_module_path_within_root_scan_is_error, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/computation_demand_duplication_witness_test.dag b/dag/test/claim/computation_demand_duplication_witness_test.dag index 393365afac0..c37fbcdeffb 100644 --- a/dag/test/claim/computation_demand_duplication_witness_test.dag +++ b/dag/test/claim/computation_demand_duplication_witness_test.dag @@ -1,4 +1,20 @@ module test.claim.computation_demand_duplication_witness +import v2.lens.duplicate_computation { + ComputationDemandFact, + ReplicationIntent, + ReplicatedOracle, + SingleRun, + TypedArgvInvocation, + UnguardedDemand, + duplicate_computation_clean_holds, + duplicate_computation_violation_count, + typed_argv_computation_demands, +} +import v2.std.logic { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/compute_fabric_resource_witness_test.dag b/dag/test/claim/compute_fabric_resource_witness_test.dag index 3f1bbdc51d9..421d52d96ca 100644 --- a/dag/test/claim/compute_fabric_resource_witness_test.dag +++ b/dag/test/claim/compute_fabric_resource_witness_test.dag @@ -1,5 +1,22 @@ module test.claim.compute_fabric_resource_witness - +import std.types { Bool } +import product.compute_fabric { + witness_need_is_only_fabric_plus_program, + witness_shape_is_derived_from_program, + witness_fabric_binds_need_to_opportunity, + witness_exec_and_ci_are_just_programs, + witness_hard_requirement_unmet_is_unmet, +} +import gunbc.fleet_container { + witness_run_demand_envelope_fits_budget, + witness_high_demand_shrinks_envelope_and_fits, + witness_fail_open_memory_blind_demand_exceeds_budget, + witness_unreadable_budget_uses_conservative_demand, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/config_record_emit_test.dag b/dag/test/claim/config_record_emit_test.dag index 1ac510b5180..ae4999da418 100644 --- a/dag/test/claim/config_record_emit_test.dag +++ b/dag/test/claim/config_record_emit_test.dag @@ -1,4 +1,30 @@ module test.claim.config_record_emit_witness +import std.languages { + yaml_format, + toml_format, + makefile_format, + gitignore_format, + json_record_knobs, + SerializationKnobs, + SerialField, + SerialValue, +} +import std.serialize { + serial_scalar, + serial_field, + serialize_field_doc, + serialize_fields_doc, + serialize_record_doc, +} +import std.layout { + render, + LayoutProtocol, +} +import gunbc.runner_deploy_emit { manifest_record_knobs } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/contracts_placement_test.dag b/dag/test/claim/contracts_placement_test.dag index 521c4165cdb..8ed064175e1 100644 --- a/dag/test/claim/contracts_placement_test.dag +++ b/dag/test/claim/contracts_placement_test.dag @@ -1,5 +1,18 @@ module test.claim.contracts_placement - +import std.bit { Bool } +import extdeps.llm.llm_contracts { llm_snake_wire_contract } +import extdeps.llm.anthropic_contracts { + anthropic_chat_message_wire_contract, + wire_contract, +} +import extdeps.github.pulls_contracts { + pull_request_state_wire_contract, + review_state_wire_contract, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cost_estimate_float_witness_test.dag b/dag/test/claim/cost_estimate_float_witness_test.dag index cf7a6dd926e..b0e19208353 100644 --- a/dag/test/claim/cost_estimate_float_witness_test.dag +++ b/dag/test/claim/cost_estimate_float_witness_test.dag @@ -1,5 +1,10 @@ module test.claim.cost_estimate_float_witness_test - +import examples.cost_estimate { cost_projection_float_witness } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cr1000a_dhcp_lease_naming_witness_test.dag b/dag/test/claim/cr1000a_dhcp_lease_naming_witness_test.dag index 840ec04a9a7..2239ac0bf87 100644 --- a/dag/test/claim/cr1000a_dhcp_lease_naming_witness_test.dag +++ b/dag/test/claim/cr1000a_dhcp_lease_naming_witness_test.dag @@ -1,5 +1,30 @@ module test.claim.cr1000a_dhcp_lease_naming - +import std.bit { Bool } +import std.types { NonEmptyStr } +import extdeps.dhcp.v4 { + MacAddress, + DynamicDhcpLease, + StaticDhcpReservation, + dhcp_lease_remaining_from_cited_minutes, + dhcp_lease_remaining_cited_minutes, +} +import extdeps.network.ipv4 { Ipv4Address } +import extdeps.systemd { Active } +import extdeps.dns.domain_name { + HostName, + DomainName, + DnsLabel, + PartiallyQualified, +} +import extdeps.router.verizon_cr1000a { + Cr1000aDhcpLeaseRow, + cr1000a_catalog, +} +import extdeps.vendor.verizon { verizon } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/cron_tag_witness_test.dag b/dag/test/claim/cron_tag_witness_test.dag index 0b1c6b6cce6..f8aa4558b74 100644 --- a/dag/test/claim/cron_tag_witness_test.dag +++ b/dag/test/claim/cron_tag_witness_test.dag @@ -1,5 +1,10 @@ module test.claim.cron_tag_witness_test - +import gunbc.tools.cron_tag { cron_tag_upsert_protocol_keystone_holds } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/crosstree_probe_test.dag b/dag/test/claim/crosstree_probe_test.dag index a26753da283..7ff3c52e505 100644 --- a/dag/test/claim/crosstree_probe_test.dag +++ b/dag/test/claim/crosstree_probe_test.dag @@ -1,5 +1,5 @@ module test.claim.crosstree_probe - +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = v2.std.live_tree.SubstrateInputsOnly diff --git a/dag/test/claim/dag_collect_fingerprint_witness_test.dag b/dag/test/claim/dag_collect_fingerprint_witness_test.dag index bf4310807f7..c94d2fc2c02 100644 --- a/dag/test/claim/dag_collect_fingerprint_witness_test.dag +++ b/dag/test/claim/dag_collect_fingerprint_witness_test.dag @@ -1,5 +1,10 @@ module test.claim.dag_collect_fingerprint_witness_test - +import tools.dag_collect_fingerprint_witness_transport { run_dag_collect_fingerprint_witness } +import v2.std.logic { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/dag_compile_clean_seam_witness_test.dag b/dag/test/claim/dag_compile_clean_seam_witness_test.dag index 88fda643287..a491abc0e0b 100644 --- a/dag/test/claim/dag_compile_clean_seam_witness_test.dag +++ b/dag/test/claim/dag_compile_clean_seam_witness_test.dag @@ -1,5 +1,14 @@ module test.claim.dag_compile_clean_seam_witness - +import tools.dag_compile_clean_seam { + witness_cross_shard_seam_preservation_holds, + witness_seam_algebra_reds_on_synthetic_break, + witness_seam_algebra_fails_closed_when_class_missing, + witness_seam_algebra_fails_closed_when_importer_silently_passes, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/dag_compile_clean_shard_a_witness_test.dag b/dag/test/claim/dag_compile_clean_shard_a_witness_test.dag index 71f25471037..14811d7179f 100644 --- a/dag/test/claim/dag_compile_clean_shard_a_witness_test.dag +++ b/dag/test/claim/dag_compile_clean_shard_a_witness_test.dag @@ -1,5 +1,23 @@ module test.claim.dag_compile_clean_shard_a_witness - +import tools.dag_compile_clean_partition { + witness_partition_pool_roots_are_compile_clean_source_roots, + witness_compose_all_clean_is_clean, + witness_compose_any_failure_fails_closed, + witness_compose_associativity, + witness_reduce_projection_preserves_compose, + witness_empty_compose_is_unknown_reduce, + compose_compile_clean_shard_verdicts, + ShardClean, + ShardFailed, +} +import tools.dag_compile_clean_shard_transport { + run_shard_a_exemplar_compile, + shard_a_exemplar_entry_path, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly data witness_compose_red_on_injected_failure: Bool = compose_compile_clean_shard_verdicts( diff --git a/dag/test/claim/deploy_access_privilege_witness_test.dag b/dag/test/claim/deploy_access_privilege_witness_test.dag index 0b20808486c..aba2ffefb08 100644 --- a/dag/test/claim/deploy_access_privilege_witness_test.dag +++ b/dag/test/claim/deploy_access_privilege_witness_test.dag @@ -1,4 +1,35 @@ module test.claim.deploy_access_privilege_witness +import std.bit { Bool } +import std.types { NonEmptyStr } +import gunbc.ci_deploy_access { + ci_deploy_srv1_access, + deploy_access_refusal_prefix, + deploy_access_privileged_fixture_actor, + deploy_access_unprivileged_fixture_actor, + deploy_access_check, + deploy_access_decision_reason, +} +import std.access { Permit } +import extdeps.access.aws_iam { Deny } +import gunbc.host_effect { + NodeControlPlane, + host_effect_identity_evidence, +} +import gunbc.host_effect_realize { + host_effect_apply_gated, + host_effect_drive_directive, + Refused, +} +import std.realization_reconcile { + reconciliation_converged, + NotConverged, + Converged, +} +import gunbc.fleet_intent { srv1_host } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/deploy_mutation_gate_witness_test.dag b/dag/test/claim/deploy_mutation_gate_witness_test.dag index d675b53ffb6..0c11219f7ec 100644 --- a/dag/test/claim/deploy_mutation_gate_witness_test.dag +++ b/dag/test/claim/deploy_mutation_gate_witness_test.dag @@ -1,4 +1,36 @@ module test.claim.deploy_mutation_gate_witness +import std.bit { Bool } +import std.types { String } +import std.access { + Permit, + Deny, + decision_meet, +} +import gunbc.ci_deploy_access { + ci_deploy_srv1_access, + deploy_access_privileged_fixture_actor, + deploy_access_unprivileged_fixture_actor, + deploy_access_decision_reason, + deploy_access_refusal_prefix, +} +import gunbc.ci_deploy_access_observe { deploy_mutation_gate } +import gunbc.ci_deploy_target_host { + DeployTargetHostObservation, + deploy_target_host_fixture_observation, + deploy_target_host_refusal_prefix, +} +import gunbc.live_deploy.apply { live_deploy_fold } +import gunbc.live_deploy.spec { deployment_spec_srv1 } +import gunbc.host_effect { host_effect_identity_evidence } +import std.realization_reconcile { + reconciliation_converged, + NotConverged, + Converged, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/descent_evidence_lattice_witness_test.dag b/dag/test/claim/descent_evidence_lattice_witness_test.dag index 579dd083e76..1040f96c1a9 100644 --- a/dag/test/claim/descent_evidence_lattice_witness_test.dag +++ b/dag/test/claim/descent_evidence_lattice_witness_test.dag @@ -1,4 +1,10 @@ module test.claim.descent_evidence_lattice +import std.bit { Bool } +import std.termination { DescentEvidence } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/design_argument_witness_test.dag b/dag/test/claim/design_argument_witness_test.dag index 0b31f470cf4..4acb20548fc 100644 --- a/dag/test/claim/design_argument_witness_test.dag +++ b/dag/test/claim/design_argument_witness_test.dag @@ -1,5 +1,24 @@ module test.claim.design_argument_witness - +import gunbc.design_argument { + design_section_1_argument, + design_argument, + design_axioms, +} +import std.syllogism { + Axiom, + NonLogicalAxiom, + Proposition, + Argument, + argument_has_no_orphan, + argument_is_acyclic, + argument_axiom_set_is_closed, + argument_form_is_valid, + argument_is_non_vacuous, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/dhcp_v4_mac_pinned_witness_test.dag b/dag/test/claim/dhcp_v4_mac_pinned_witness_test.dag index 073f540c1e8..985e69f74be 100644 --- a/dag/test/claim/dhcp_v4_mac_pinned_witness_test.dag +++ b/dag/test/claim/dhcp_v4_mac_pinned_witness_test.dag @@ -1,5 +1,14 @@ module test.claim.dhcp_v4_mac_pinned_witness - +import std.bit { Bool } +import extdeps.dhcp.v4 { + dhcp_mac_pinned_reservation_not_contradictory, + StaticConfig, + StaticReservation, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/diagnostic_redfish_witness.dag b/dag/test/claim/diagnostic_redfish_witness.dag index c80f0ecb4c8..516521cbfce 100644 --- a/dag/test/claim/diagnostic_redfish_witness.dag +++ b/dag/test/claim/diagnostic_redfish_witness.dag @@ -1,4 +1,7 @@ module test.claim.diagnostic_redfish_witness +import std.types { NonEmptyStr } + +import extdeps.bmc.http data closed_loopback_bmc_host: NonEmptyStr = "127.0.0.1" diff --git a/dag/test/claim/docker_container_stats_witness_test.dag b/dag/test/claim/docker_container_stats_witness_test.dag index 20ece04a0e4..1486f776155 100644 --- a/dag/test/claim/docker_container_stats_witness_test.dag +++ b/dag/test/claim/docker_container_stats_witness_test.dag @@ -1,5 +1,44 @@ module test.claim.docker_container_stats_witness - +import extdeps.docker.container_stats { + CpuStats, + CpuUsage, + MemoryStats, + ContainerStats, + PidStats, + NetworkStats, + NetworkInterface, + Networks, + container_stats_memory_usage, + container_stats_cpu_usage_total, + container_stats_online_cpus, +} +import extdeps.docker.container_inspect { + ContainerState, + ContainerStateDetail, + HostConfig, + ContainerConfig, + ContainerInspect, + NetworkSettings, + container_inspect_memory_limit, + container_inspect_cpu_quota, + container_inspect_cpu_period, + parse_container_state, + container_state_wire_label, + Running, + Exited, + Paused, + Dead, + Restarting, +} +import std.measure { + byte_size, + nanosecond, + microsecond, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/domain_name_parse_witness_test.dag b/dag/test/claim/domain_name_parse_witness_test.dag index 552fa71d12b..52d42d83852 100644 --- a/dag/test/claim/domain_name_parse_witness_test.dag +++ b/dag/test/claim/domain_name_parse_witness_test.dag @@ -1,5 +1,24 @@ module test.claim.domain_name_parse - +import std.bit { Bool } +import std.error_primitives { + Ok, + Err, +} +import extdeps.dns.domain_name { + parse_host_name, + host_name_eq, + host_name_label_count, + PartiallyQualified, + LabelTooLong, + NameTooLong, + BadLabelChar, + EdgeHyphen, +} +import std.render_repeat_string_bootstrap { repeat_string } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/ebay_listing_witness_test.dag b/dag/test/claim/ebay_listing_witness_test.dag index a8ad00959c5..6c08ae02e82 100644 --- a/dag/test/claim/ebay_listing_witness_test.dag +++ b/dag/test/claim/ebay_listing_witness_test.dag @@ -1,5 +1,40 @@ module test.claim.ebay_listing_witness - +import extdeps.ebay.ebay { + MarketplaceEnum, + EbayUs, + EbayGb, + marketplace_wire_label, + parse_marketplace, +} +import extdeps.ebay.inventory { + ConditionEnum, + New, + UsedExcellent, + ForPartsOrNotWorking, + condition_wire_label, + parse_condition, + FormatTypeEnum, + Auction, + FixedPrice, + format_type_wire_label, + parse_format_type, +} +import extdeps.ebay.errors { + EbayErrorCategory, + Request, + error_category_wire_label, + parse_error_category, +} +import extdeps.ebay.oauth { + EbayTokenType, + UserAccessToken, + parse_ebay_token_type, +} +import gunbc.tools.ebay_listing { default_marketplace } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/effects_rest_transport_parse_witness_test.dag b/dag/test/claim/effects_rest_transport_parse_witness_test.dag index 3a061ec42fb..db7c277faec 100644 --- a/dag/test/claim/effects_rest_transport_parse_witness_test.dag +++ b/dag/test/claim/effects_rest_transport_parse_witness_test.dag @@ -1,5 +1,10 @@ module test.claim.effects_rest_transport_parse_witness_test - +import tools.effects_rest_transport_witness_transport { run_effects_rest_transport_witness } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/emit_host_gate_verdicts_test.dag b/dag/test/claim/emit_host_gate_verdicts_test.dag index 07142a94619..12dc0c28bbf 100644 --- a/dag/test/claim/emit_host_gate_verdicts_test.dag +++ b/dag/test/claim/emit_host_gate_verdicts_test.dag @@ -1,5 +1,9 @@ module test.claim.emit_host_gate_verdicts_test - +import std.process { ProcessExit } +import tools.emit_host_gate { + smoke_verdict_line, + gate_failure_exit, +} data emit_host_gate_verdicts_red_doc: String = "Discriminating controls for the per-smoke verdict line (tools.emit_host_gate.per_smoke_verdict_note): the refusal reason must NAME each failing smoke — the defect this dissolves is a five-smokes-into-one-Bool fold whose failure was unnameable from the receipt (2026-07-13 srv3 forensics receipt). A regression that drops a smoke from the line, swaps pass/FAIL polarity, or degenerates the join to empty goes RED on the exact-string pins below." diff --git a/dag/test/claim/emit_host_gate_witness_test.dag b/dag/test/claim/emit_host_gate_witness_test.dag index 39ccb39670b..db808a9737e 100644 --- a/dag/test/claim/emit_host_gate_witness_test.dag +++ b/dag/test/claim/emit_host_gate_witness_test.dag @@ -1,4 +1,17 @@ module test.claim.emit_host_gate_witness +import std.measure { byte_size_count } +import tools.emit_host_fixtures { + rust_stdout_fixture_source, + python_stdout_fixture_source, + go_stdout_fixture_source, + ts_host_fixture_source, + stdout_byte_count, + ts_signed_i32_le_byte_count, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/emit_host_typed_smoke_test.dag b/dag/test/claim/emit_host_typed_smoke_test.dag index 5afc3d50aaa..66f237584e1 100644 --- a/dag/test/claim/emit_host_typed_smoke_test.dag +++ b/dag/test/claim/emit_host_typed_smoke_test.dag @@ -1,4 +1,9 @@ module test.claim.emit_host_typed_smoke_test +import tools.emit_host_transport { expected_stdout_nul_run } + +import extdeps.shell +import extdeps.filesystem.filesystem_io +import extdeps.python data emit_host_typed_smoke_red_doc: String = "Discriminating controls for the typed emit-host smokes (tools.emit_host_transport). The smokes assert CONTENT equality against the in-substrate NUL golden; the control below emits five SPACES - byte-count-identical to the golden - and asserts inequality, so a regression of the mechanism back to count comparison (the old wc -c check) or an equality that fabricates true goes RED here. The pure shape tests pin the golden itself so repeat_string/from_code_point cannot silently degenerate to the empty string (which trailing-whitespace trims would then match)." diff --git a/dag/test/claim/env_freshness_witness.dag b/dag/test/claim/env_freshness_witness.dag index 9e8a4522a76..13df4663007 100644 --- a/dag/test/claim/env_freshness_witness.dag +++ b/dag/test/claim/env_freshness_witness.dag @@ -1,4 +1,7 @@ module test.claim.env_freshness_witness +import std.types { NonEmptyStr } + +import extdeps.shell data path_env_name: NonEmptyStr = "PATH" diff --git a/dag/test/claim/extdeps_anemia_grounding_witness_test.dag b/dag/test/claim/extdeps_anemia_grounding_witness_test.dag index 7f33aff2374..2c7c10daf19 100644 --- a/dag/test/claim/extdeps_anemia_grounding_witness_test.dag +++ b/dag/test/claim/extdeps_anemia_grounding_witness_test.dag @@ -1,4 +1,50 @@ module test.claim.extdeps_anemia_grounding_witness +import extdeps.git { GitAuthor } +import extdeps.github.pulls { + PullRequest, + PullRequestRef, + PullReview, + ReviewComment, + Commented, + Open, +} +import extdeps.github.github { + GitHubUser, + User, +} +import extdeps.cpu.types { + CpuModelCatalogRow, + CpuSocket, + LandGridArray, +} +import extdeps.toolchain.types { Aarch64 } +import extdeps.cpu.ampere { + altra_max_m12830_catalog, + ampere_altra_l1_cache_citations, + ampere_altra_l1_cache_geometry, + ampere_altra_l2_cache_citations, + ampere_altra_l2_cache_geometry, + ampere_altra_max_l3_cache_citations, + ampere_altra_max_l3_cache_geometry, +} +import extdeps.vendor.ampere { ampere } +import gunbc.digest_render { digest_subject } +import std.measure { + watt, + watt_count, + hardware_thread_count, + hertz, +} +import std.types { + Email, + CommitSha, + GitRef, + FilePath, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/extdeps_git_diff_name_status_witness_test.dag b/dag/test/claim/extdeps_git_diff_name_status_witness_test.dag index 6116838e4be..a250019f870 100644 --- a/dag/test/claim/extdeps_git_diff_name_status_witness_test.dag +++ b/dag/test/claim/extdeps_git_diff_name_status_witness_test.dag @@ -1,4 +1,27 @@ module test.claim.extdeps_git_diff_name_status_witness +import std.bit { Bool } +import std.measure { percent_count } +import extdeps.git { + GitDiffChangeStatus, + GitDiffStatusEntry, + GitDiffNameStatusComplete, + GitDiffNameStatusTruncated, + DiffAddedStatus, + DiffCopiedStatus, + DiffDeletedStatus, + DiffModifiedStatus, + DiffRenamedStatus, + DiffUnknownGitStatus, + git_diff_name_status_field_separator, + git_diff_name_status_parse, + git_diff_status_entries_touched_paths, + git_diff_status_entries_departed_paths, + git_diff_status_entries_any_unknown, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/extdeps_git_versioning_witness_test.dag b/dag/test/claim/extdeps_git_versioning_witness_test.dag index 883bb809bbd..c6d15e46aeb 100644 --- a/dag/test/claim/extdeps_git_versioning_witness_test.dag +++ b/dag/test/claim/extdeps_git_versioning_witness_test.dag @@ -1,4 +1,26 @@ module test.claim.extdeps_git_versioning_witness +import std.bit { Bool } +import std.algebra { + Less, + Equal, + Greater, +} +import extdeps.git.versioning { + GitReleaseVersion, + GitCliReportedVersion, + GitVersionPlain, + GitVersionWindows, + git_2_0_release, + git_release_versioning_spec_url, + git_release_version_compare, + git_release_to_version_identity, + git_release_version_scheme, + min_git_version, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/extdeps_github_errors_url_grounding_witness_test.dag b/dag/test/claim/extdeps_github_errors_url_grounding_witness_test.dag index ebf3017bb4d..88b7c90c22e 100644 --- a/dag/test/claim/extdeps_github_errors_url_grounding_witness_test.dag +++ b/dag/test/claim/extdeps_github_errors_url_grounding_witness_test.dag @@ -1,4 +1,13 @@ module test.claim.extdeps_github_errors_url_grounding_witness +import extdeps.github.errors { + GitHubErrorShape, + github_error_example, +} +import std.types { NonEmptyStr } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/extdeps_llm_type_grounding_witness_test.dag b/dag/test/claim/extdeps_llm_type_grounding_witness_test.dag index 17f394064c7..d0148e077a0 100644 --- a/dag/test/claim/extdeps_llm_type_grounding_witness_test.dag +++ b/dag/test/claim/extdeps_llm_type_grounding_witness_test.dag @@ -1,4 +1,84 @@ module test.claim.extdeps_llm_type_grounding_witness +import extdeps.llm.openai { + ToolCall, + FunctionCall, + OpenAiToolCallFunction, + OpenAiToolCallTypeOther, + OpenAiResponsesOutputText, + OpenAiResponsesOutputContentTypeOther, + OpenAiResponsesOutputMessage, + OpenAiResponsesOutputItemTypeOther, + OpenAiResponses200OutputContent, + OpenAiResponses200OutputItem, + OpenAiResponsesStatusCompleted, + OpenAiResponsesStatusIncomplete, + OpenAiResponsesStatusOther, + OpenAiResponsesOutputItemInProgress, + OpenAiResponsesOutputItemStatusOther, + parse_openai_tool_call_type, + openai_tool_call_type_label, + parse_openai_responses_output_content_type, + openai_responses_output_content_type_label, + parse_openai_responses_output_item_type, + openai_responses_output_item_type_label, + parse_openai_responses_status, + openai_responses_status_label, + parse_openai_responses_output_item_status, + openai_responses_output_item_status_label, +} +import extdeps.llm.openai_errors { + OpenAiErrorDetails, + OpenAiInvalidRequestError, + OpenAiAuthenticationError, + OpenAiPermissionError, + OpenAiNotFoundError, + OpenAiRateLimitError, + OpenAiApiError, + OpenAiInsufficientQuota, + OpenAiErrorTypeOther, + parse_openai_error_type, + openai_error_type_label, +} +import extdeps.llm.anthropic { + Base64Image, + UrlImage, + ImageJpeg, + ImagePng, + ImageGif, + ImageWebp, + AnthropicImageMediaTypeOther, + CacheControl, + CacheEphemeral, + AnthropicMessages200Body, + MessagesObjectMessage, + Assistant, + MessagesTextBlock, + EndTurn, + AnthropicMessages200Usage, + Standard, + parse_anthropic_image_media_type, + anthropic_image_media_type_label, + cache_control_type_label, + anthropic_messages_object_type_label, +} +import extdeps.llm.anthropic_errors { + AnthropicErrorEnvelope, + AnthropicAuthenticationError, + AnthropicInvalidRequestError, + AnthropicRateLimitError, + AnthropicOverloadedError, + AnthropicNotFoundError, + AnthropicApiError, + AnthropicErrorTypeOther, + anthropic_error_example, + parse_anthropic_error_type, + anthropic_error_type_label, + anthropic_error_envelope_type_label, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/extdeps_round2_grounding_witness_test.dag b/dag/test/claim/extdeps_round2_grounding_witness_test.dag index 1498cfed014..569fda42638 100644 --- a/dag/test/claim/extdeps_round2_grounding_witness_test.dag +++ b/dag/test/claim/extdeps_round2_grounding_witness_test.dag @@ -1,4 +1,70 @@ module test.claim.extdeps_round2_grounding_witness +import extdeps.sql.migration { + SqlDialect, + Postgres, + Mysql, + Sqlite, + SqlMigrationStep, + CreateTable, + sql_dialect_wire_label, +} +import extdeps.http.server { ServedStaticRoute } +import extdeps.cloud.cloud { + CloudAuthScheme, + SigV4, + Protocol, + OidcToken, + AwsRegion, + AwsService, + UsEast1, + S3, + aws_region_wire_label, + aws_service_wire_label, +} +import extdeps.cloud.gcp.errors { + GcpErrorShape, + GcpRpcCode, + GcpRpcCodePermissionDenied, + GcpRpcCodeNotFound, + GcpRpcCodeOk, + GcpRpcCodeOther, + gcp_error_example, + parse_gcp_rpc_code, + gcp_rpc_code_label, +} +import extdeps.cloud.gcp.gcp { + GcpApiEndpoint, + GcpProject, + GcpServiceAccount, + GcpStorage, + GcpSts, + gcp_service_wire_label, +} +import extdeps.gpu.types { + GpuFacts, + AcceleratorFacts, + GpuComputeCapability, + GpuCapabilityLabelOk, + GpuCapabilityLabelRejected, + UnsubstantiatedGpuCapabilityLabel, + gpu_compute_capability_sm_label, +} +import extdeps.memory.types { + MemoryFacts, + MemoryKind, + Hbm, +} +import extdeps.vendor.nvidia { nvidia } +import extdeps.vendor.amd { amd } +import extdeps.vendor.intel { intel } +import extdeps.vendor.ampere { ampere } +import std.http_path { PathTemplate } +import std.measure { byte_size } +import std.types { GET } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/extdeps_version_semver_witness_test.dag b/dag/test/claim/extdeps_version_semver_witness_test.dag index 552b7c4fa46..224f2a3e0ad 100644 --- a/dag/test/claim/extdeps_version_semver_witness_test.dag +++ b/dag/test/claim/extdeps_version_semver_witness_test.dag @@ -1,4 +1,25 @@ module test.claim.extdeps_version_semver +import extdeps.version.semver { + SemVerIdentity, + SemVerConstraint, + SemVerVersion, + SemVerNumericIdentifier, + SemVerAlphanumericIdentifier, + semver_scheme, + semver_compare, + semver_compare_identifier, + semver_to_version_identity, + semver_version_label, +} +import std.algebra { + Equal, + Less, + Greater, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/extdeps_version_witness_test.dag b/dag/test/claim/extdeps_version_witness_test.dag index a0fe3b131e7..09ff4c48d45 100644 --- a/dag/test/claim/extdeps_version_witness_test.dag +++ b/dag/test/claim/extdeps_version_witness_test.dag @@ -1,4 +1,19 @@ module test.claim.extdeps_version_base +import extdeps.version { + VersionIdentity, + VersionConstraint, +} +import extdeps.tools.gnu_coreutils { min_coreutils_version } +import std.algebra { + Ordering, + Less, + Equal, + Greater, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/filesystem_entry_kind_witness_test.dag b/dag/test/claim/filesystem_entry_kind_witness_test.dag index d34c15f9e5a..563aeeb62a2 100644 --- a/dag/test/claim/filesystem_entry_kind_witness_test.dag +++ b/dag/test/claim/filesystem_entry_kind_witness_test.dag @@ -1,4 +1,21 @@ module test.claim.filesystem_entry_kind_witness +import std.filesystem.types { EntryKind } +import extdeps.filesystem.posix { + posix_entry_kind, + S_IFREG, + S_IFLNK, + S_IFSOCK, +} +import extdeps.filesystem.ntfs { + ntfs_entry_kind, + NormalFile, + SymlinkReparse, + MountPointReparse, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/filesystem_write_closure_scale_witness.dag b/dag/test/claim/filesystem_write_closure_scale_witness.dag index 5b3dfb24574..6ba8ebf92cf 100644 --- a/dag/test/claim/filesystem_write_closure_scale_witness.dag +++ b/dag/test/claim/filesystem_write_closure_scale_witness.dag @@ -1,4 +1,7 @@ module test.claim.filesystem_write_closure_scale_witness +import std.resources { ResourceHandle } + +import extdeps.filesystem.filesystem_io data filesystem_write_closure_scale_anchor: ResourceHandle = ResourceHandle { diff --git a/dag/test/claim/fleet_converge_apply_witness_test.dag b/dag/test/claim/fleet_converge_apply_witness_test.dag index 7c6df6451cd..5f40622e026 100644 --- a/dag/test/claim/fleet_converge_apply_witness_test.dag +++ b/dag/test/claim/fleet_converge_apply_witness_test.dag @@ -1,4 +1,54 @@ module test.claim.fleet_converge_apply_witness +import std.bit { Bool } +import std.types { String } +import gunbc.host_converge { + ConvergePolicy, + ConvergePolicyDerived, + ConvergePolicyUnsound, + HostConverge, + ConvergeKnob, + GunbcSlice, + FreshStandup, + BlindApply, + GunbcPinnedTree, + DeferToSubmodule, + NoMembershipProbe, + gunbc_pinned_tree_desired_label, + gunbc_root_env_key, + gunbc_host_gunbc_root_path, + gunbc_dag_root_submodule_path, + gunbc_host_ctrl_checkout_path, + gunbc_ctrl_read_pin_script, + gunbc_pinned_binary_provenance_policy, + gunbc_green_place_marker_spec, + gunbc_dashboard_live_apply_policy, +} +import gunbc.fleet_converge_apply { + converge_apply, + FleetConvergeApplyRefused, + fleet_converge_apply_result_converged, + fleet_converge_thin_invocation, +} +import gunbc.host_effect { + EmitArtifactThenThinRun, + BootstrapFragment, + bootstrap_fragment_script_carrier_scaffold, + thin_invocation_argv_carrier_scaffold, +} +import std.disposition { + Scaffold, + RealizationDispatch, + Terminal, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import gunbc.fleet_intent_network { operator_host_srv3 } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/fleet_converge_cli_witness_test.dag b/dag/test/claim/fleet_converge_cli_witness_test.dag index be8f41d2c5a..3479a107476 100644 --- a/dag/test/claim/fleet_converge_cli_witness_test.dag +++ b/dag/test/claim/fleet_converge_cli_witness_test.dag @@ -1,4 +1,30 @@ module test.claim.fleet_converge_cli_witness +import std.bit { Bool } +import gunbc.host_converge { + VerdictConverged, + converge_verdict, + converge_verdict_label, +} +import gunbc.fleet_intent_network { operator_host_srv1 } +import gunbc.host_converge_slice1 { host_converge_slice1_fixture_receipt } +import gunbc.fleet_converge_cli { + ConvergeCliReceipt, + ConvergeCliRefusalCause, + PolicyUnsound, + UnknownHost, + ComputeInventoryAbsent, + KnobFrontier, + converge_cli_run, + converge_cli_routes_to_slice1, + converge_cli_receipt_line, + converge_cli_receipt_converged, + converge_cli_output, + converge_cli_refusal_message, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/fleet_intent_network_witness_test.dag b/dag/test/claim/fleet_intent_network_witness_test.dag index ee4b3ac4a17..78bed969d33 100644 --- a/dag/test/claim/fleet_intent_network_witness_test.dag +++ b/dag/test/claim/fleet_intent_network_witness_test.dag @@ -1,5 +1,20 @@ module test.claim.fleet_intent_network - +import std.bit { Bool } +import std.types { list_length } +import product.network_topology { + HostLan, + BmcManagement, + network_reachability, +} +import gunbc.fleet_intent_network { + fleet_intent_network, + srv1_bmc_endpoint, + srv1_host_lan_endpoint, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/fleet_intent_storage_witness_test.dag b/dag/test/claim/fleet_intent_storage_witness_test.dag index 85c46eb3f8b..f2129df7389 100644 --- a/dag/test/claim/fleet_intent_storage_witness_test.dag +++ b/dag/test/claim/fleet_intent_storage_witness_test.dag @@ -1,5 +1,28 @@ module test.claim.fleet_intent_storage - +import std.bit { Bool } +import std.types { list_length } +import std.measure { byte_size_count } +import gunbc.fleet_intent { + srv1_host, + srv2_host, + srv3_host, + srv1_nvme0, + srv3_nvme0, +} +import extdeps.observability { + OutOfBand, + StorageInventory, + route_observation, +} +import extdeps.storage.types { + storage_device_capacity, + storage_device_pcie_link, + storage_device_serial, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/fleet_show_effective_read_witness_test.dag b/dag/test/claim/fleet_show_effective_read_witness_test.dag index df11ec74b87..c547240b3ac 100644 --- a/dag/test/claim/fleet_show_effective_read_witness_test.dag +++ b/dag/test/claim/fleet_show_effective_read_witness_test.dag @@ -1,4 +1,94 @@ module test.claim.fleet_show_effective_read_witness +import std.types { + Bool, + NonEmptyStr, + String, +} +import std.measure { + byte_size_count, + percent, + percent_count, +} +import extdeps.systemd { + MemoryLimitAbsent, + MemoryLimitUnbounded, + parse_systemd_memory_limit_show, + systemd_memory_max_property, +} +import extdeps.systemd.oomd { + managed_oom_pressure_limit_show_value, + managed_oom_pressure_limit_wire_matches_percent, + parse_managed_oom_pressure_limit_show, +} +import gunbc.host_converge { + Drifted, + PerSlotMemoryCap, + VerdictConverged, + gunbc_runner_per_slot_dropin_path, + runner_instance_glob, +} +import gunbc.fleet_host_budget { + declared_runner_count, + gunbc_runner_pool_budget, +} +import gunbc.ci_floor_measurement { + CapUnbounded, + gunbc_ci_runner_cgroup_memory_cap, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import gunbc.oomd_install { gunbc_oomd_sessions_policy } +import gunbc.fleet_show_effective_read { + RunnerSliceCapLiveReadRow, + fixture_srv1_host_effective_read_grounded_receipt, + fixture_srv2_host_effective_read_grounded_receipt, + fleet_receipt_lists_unit, + fleet_receipt_unit_count, + grounded_receipt_has_observed_v0_knobs, + gunbc_fleet_host_effective_read_show_effective_read, + gunbc_fleet_runner_slice_cap_show_effective_read, + gunbc_fleet_runner_units_show_effective_read, + gunbc_fleet_runner_width_show_effective_read, + gunbc_srv1_oom_pressure_limit_fixture_row, + gunbc_srv1_runner_slice_cap_fixture_row, + gunbc_srv1_runner_width_fixture_row, + gunbc_srv2_runner_slice_cap_fixture_row, + gunbc_srv2_runner_width_fixture_row, + oom_pressure_limit_converge_verdict, + oom_pressure_limit_live_read_typed, + parse_runner_width_active_count, + runner_slice_cap_live_read_typed, + runner_width_converge_verdict, + runner_width_live_read_typed, + show_effective_read_cannot_converge, + show_effective_read_from_slice_cap_row, + slice_property_memory_max_verdict, +} +import gunbc.runner_unit_live_read { + converge_target_live_verdict, + gunbc_srv1_runner_unit_live_read_fixture, + runner_unit_live_read_typed, +} +import gunbc.runner_slot_enforcement { + RunnerSlotEnforced, + RunnerSlotUnenforced, + gunbc_runner_slot_enforcement_committed, +} +import std.realization_reconcile { + ReadAbsent, + ReadObserved, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import gunbc.systemctl_show_read { + systemctl_show_property_operation_argv, + systemctl_show_property_operation_argv_matches_transport, + systemctl_show_property_read_local, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/floor_discovery_hand_rust_equivalence_witness_test.dag b/dag/test/claim/floor_discovery_hand_rust_equivalence_witness_test.dag index bd39a237e3b..ff8316f1c6b 100644 --- a/dag/test/claim/floor_discovery_hand_rust_equivalence_witness_test.dag +++ b/dag/test/claim/floor_discovery_hand_rust_equivalence_witness_test.dag @@ -23,16 +23,16 @@ import v2.workflow.floor_discovery_producer { FloorDiscoveryAccepted, FloorDiscoveryRefused, discover_floor_corpus_rows_from_host_facts, - floor_discovery_scan_test_decl_names, floor_discovery_content_has_wire_contract_decl, floor_discovery_wire_contract_sidecar_refusal_for_content, floor_discovery_entry_live_tree_disposition_refusal_for_content, - floor_filename_hygiene_refusal_for_paths, floor_discovery_sidecar_refusal_reason, floor_discovery_surface_text_scan_scaffold, floor_discovery_surface_text_scan_dissolve_on } import v2.workflow.floor_naming_hygiene { + floor_filename_hygiene_refusal_for_paths, + floor_discovery_scan_test_decl_names, floor_test_sidecar_suffix, floor_wire_contract_sidecar_suffix } diff --git a/dag/test/claim/floor_skip_discovery_witness_test.dag b/dag/test/claim/floor_skip_discovery_witness_test.dag index 743eddb84ff..12ff899ef20 100644 --- a/dag/test/claim/floor_skip_discovery_witness_test.dag +++ b/dag/test/claim/floor_skip_discovery_witness_test.dag @@ -1,5 +1,10 @@ module test.claim.floor_skip_discovery_witness_test - +import tools.floor_skip_discovery_witness_transport { run_floor_skip_discovery_witness } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/gcp_oauth_access_token_witness.dag b/dag/test/claim/gcp_oauth_access_token_witness.dag index 9e73bc912bf..bd10be32c98 100644 --- a/dag/test/claim/gcp_oauth_access_token_witness.dag +++ b/dag/test/claim/gcp_oauth_access_token_witness.dag @@ -1,5 +1,19 @@ module test.claim.gcp_oauth_access_token_witness - +import extdeps.cloud.gcp.gcp { + AdcRefresh, + GcloudCli, + GcpOAuth2AccessTokenStrategy, +} +import std.bit { Bool } +import std.types { + FilePath, + Secret, +} +import gunbc.auth.credentials { + gcp_oauth_access_token, + gcp_oauth_access_token_via_adc_refresh, + gcp_oauth_access_token_via_gcloud, +} data witness_adc_path: std.types.FilePath = "/tmp/gunbc_gcp_oauth_witness_adc.json" diff --git a/dag/test/claim/gha_expression_roundtrip_test.dag b/dag/test/claim/gha_expression_roundtrip_test.dag index 5d3c595978b..16b5a602289 100644 --- a/dag/test/claim/gha_expression_roundtrip_test.dag +++ b/dag/test/claim/gha_expression_roundtrip_test.dag @@ -1,4 +1,36 @@ module test.claim.gha_expression_roundtrip +import extdeps.github.expressions { + Expression, + ContextAccess, + FunctionCall, + StringLiteral, + LogicalOr, + ExpressionTemplate, + TemplateSegment, + LiteralText, + Interpolation, + ExpressionSpellings, + default_expression_spellings, + serialize_expression, + serialize_expression_with, + serialize_template, + serialize_template_with, + ingest_expression, + ingest_expression_with, + ingest_template, + Github, + Runner, + HashFiles, + Contains, + FromJSON, + Format, +} +import extdeps.communication.fidelity_carriers { source_medium_carried } +import extdeps.communication.medium { Lossless } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/github_checks_witness_test.dag b/dag/test/claim/github_checks_witness_test.dag index 93c66e6b65c..f389ef8b075 100644 --- a/dag/test/claim/github_checks_witness_test.dag +++ b/dag/test/claim/github_checks_witness_test.dag @@ -1,5 +1,24 @@ module test.claim.github_checks_witness - +import extdeps.github.checks { + CheckStatus, + CheckConclusion, + CheckOutput, + CheckRun, + CheckRunList, + InProgress, + Completed, + Success, + Failure, + TimedOut, + parse_check_status, + parse_check_conclusion, + check_status_wire_label, + check_conclusion_wire_label, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly data sample_check_output: CheckOutput = CheckOutput { diff --git a/dag/test/claim/github_merge_state_witness_test.dag b/dag/test/claim/github_merge_state_witness_test.dag index acdf8933108..31d3dfd2a69 100644 --- a/dag/test/claim/github_merge_state_witness_test.dag +++ b/dag/test/claim/github_merge_state_witness_test.dag @@ -1,5 +1,13 @@ module test.claim.github_merge_state_witness - +import extdeps.github.merge_state { + MergeStateStatus, + Clean, + Blocked, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/github_mergeable_state_witness_test.dag b/dag/test/claim/github_mergeable_state_witness_test.dag index ffec99f0888..f569f36d793 100644 --- a/dag/test/claim/github_mergeable_state_witness_test.dag +++ b/dag/test/claim/github_mergeable_state_witness_test.dag @@ -1,5 +1,15 @@ module test.claim.github_mergeable_state_witness - +import extdeps.github.mergeable_state { + MergeableState, + Mergeable, + Conflicting, + parse_mergeable_state, + mergeable_state_wire_label, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/github_workflow_runs_witness_test.dag b/dag/test/claim/github_workflow_runs_witness_test.dag index 749384c11fb..702af0905ab 100644 --- a/dag/test/claim/github_workflow_runs_witness_test.dag +++ b/dag/test/claim/github_workflow_runs_witness_test.dag @@ -1,5 +1,32 @@ module test.claim.github_workflow_runs_witness - +import extdeps.github.workflow_runs { + WorkflowRunStatus, + WorkflowRunConclusion, + WorkflowRun, + WorkflowRunList, + Queued, + InProgress, + Completed, + Waiting, + Requested, + Pending, + Success, + Failure, + Cancelled, + Neutral, + Skipped, + TimedOut, + ActionRequired, + StartupFailure, + parse_workflow_run_status, + workflow_run_status_wire_label, + parse_workflow_run_conclusion, + workflow_run_conclusion_wire_label, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/gitignore_gate_test.dag b/dag/test/claim/gitignore_gate_test.dag index f54bf1df24c..ac8490def0f 100644 --- a/dag/test/claim/gitignore_gate_test.dag +++ b/dag/test/claim/gitignore_gate_test.dag @@ -1,4 +1,12 @@ module test.claim.gitignore_gate +import gunbc.gitignore_emit { + expected_gitignore, + gitignore_drifted, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/go_module_versioning_witness_test.dag b/dag/test/claim/go_module_versioning_witness_test.dag index 52e587177f5..59092a248bd 100644 --- a/dag/test/claim/go_module_versioning_witness_test.dag +++ b/dag/test/claim/go_module_versioning_witness_test.dag @@ -1,4 +1,35 @@ module test.claim.go_module_versioning_witness +import std.bit { Bool } +import std.types { + Int, + List, +} +import std.algebra { + Ordering, + Less, + Equal, + Greater, +} +import extdeps.languages.go.emit { go_manifest_file } +import extdeps.languages.go.module { + GoMvsProperty, + GoMajorVersionSuffix, + GoSemVer, + MajorV0OrV1, + MajorV2Plus, + go_major_suffix_str, + go_semver_label, + go_semver_to_version_identity, + go_semver_compare, + go_module_version_scheme, + go_mvs_properties, + emit_host_min_go_language_version, + emit_host_bootstrap_toolchain, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/grounded_principal_witness_test.dag b/dag/test/claim/grounded_principal_witness_test.dag index a43eb322270..7c17b011838 100644 --- a/dag/test/claim/grounded_principal_witness_test.dag +++ b/dag/test/claim/grounded_principal_witness_test.dag @@ -1,4 +1,66 @@ module test.claim.grounded_principal_witness +import std.types { + NonEmptyStr, + Bool, +} +import gunbc.fleet_posix_accounts { + FleetAccountCiRunner, + FleetAccountOperator, + FleetAccountRoot, + GroundedPosixPrincipal, + PosixAccountDeclaredProbe, + PosixSudoGrant, + fleet_posix_principal, + grounded_posix_principal_name, + fleet_posix_account_from_name, + fleet_posix_account_exists, + posix_declared_probe_names_principal, + fleet_operator_email, + fleet_operator_gcp_iam_member, + fleet_apt_get_binary_path, + posix_sudo_grant_to_effect_grant, +} +import std.effect_grant { + Execute, + verb_eq, + grant_verb, + filesystem_position, + grant_root, + position_under, + verb_of_effect_shape, +} +import std.effects { ExecuteEffect } +import gunbc.ci_deploy_access { + ci_deploy_srv1_access, + ci_deploy_srv1_operator_access, + deploy_preflight_shell_header, + deploy_access_apt_get_binary_path, + deploy_access_apt_get_privileged_command, + grounded_principal_privileged_commands, + srv1_live_deploy_privileged_commands, + deploy_access_privileged_fixture_actor, +} +import gunbc.ci_deploy_access_observe { deploy_mutation_gate } +import std.access { Permit } +import extdeps.access.aws_iam { Deny } +import gunbc.ci_deploy_target_host { + DeployTargetHostObservation, + deploy_target_host_fixture_observation, +} +import gunbc.host_identity_access { host_identity_operator_principal_name } +import gunbc.tailscale_acl_phase2_credential { + tailscale_acl_operator_email, + operator_principal_member, + operator_tailscale_acl_secret_bindings, +} +import extdeps.github.expressions { + context_name, + Runner, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/gunbhub_react_browse_witness_test.dag b/dag/test/claim/gunbhub_react_browse_witness_test.dag index b379e4d214b..b014d7e07f9 100644 --- a/dag/test/claim/gunbhub_react_browse_witness_test.dag +++ b/dag/test/claim/gunbhub_react_browse_witness_test.dag @@ -1,5 +1,14 @@ module test.claim.gunbhub_react_browse_witness - +import gunbc.gunbhub_serve { gunbhub_browse_page } +import extdeps.languages.html { + EmitOk, + EmitRejected, + try_serialize_html_source, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/gunbhub_serve_witness_test.dag b/dag/test/claim/gunbhub_serve_witness_test.dag index f04d01c4fd5..460c4a1af1a 100644 --- a/dag/test/claim/gunbhub_serve_witness_test.dag +++ b/dag/test/claim/gunbhub_serve_witness_test.dag @@ -1,5 +1,38 @@ module test.claim.gunbhub_serve_witness - +import gunbc.gunbhub_serve { + GunbhubServeRequest, + GunbhubPageSource, + ReactPage, + ComposedOk, + ComposeRejected, + Served, + RenderRejectedBeforeServe, + RouteNotFound, + MethodNotAllowed, + gunbhub_browse_page, + gunbhub_readme_page, + gunbhub_hostile_page, + gunbhub_browse_route, + gunbhub_repo_path_route, + gunbhub_browse_path_template, + gunbhub_repo_path_template, + gunbhub_html_content_type, + gunbhub_node_route_bindings, + gunbhub_served_static_route_table, + gunbhub_compose_body, + path_matches_template, + serve_gunbhub_request, + serve_gunbhub_page_source, +} +import gunbc.gunbhub_serve_html { gunbhub_html_render_keystone_holds } +import std.types { + GET, + POST, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/hand_lens_host_bridge_scaffold_watchdog_test.dag b/dag/test/claim/hand_lens_host_bridge_scaffold_watchdog_test.dag index 483194458a1..e24c9127234 100644 --- a/dag/test/claim/hand_lens_host_bridge_scaffold_watchdog_test.dag +++ b/dag/test/claim/hand_lens_host_bridge_scaffold_watchdog_test.dag @@ -1,5 +1,15 @@ module test.claim.hand_lens_host_bridge_scaffold_watchdog - +import gunbc.hand_lens_host_bridge_scaffold_watchdog { + hand_lens_host_bridge_scaffold_roster_tracked, + transport_script_position_scaffold_row, + scaffold_dissolution_trigger_matches_authority, + scaffold_dissolution_trigger_nonempty, +} +import std.types { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/hardware_selection_witness_test.dag b/dag/test/claim/hardware_selection_witness_test.dag index 5c7507e36a6..cc4fe55600f 100644 --- a/dag/test/claim/hardware_selection_witness_test.dag +++ b/dag/test/claim/hardware_selection_witness_test.dag @@ -1,4 +1,75 @@ module test.claim.hardware_selection +import std.bit { Bool } +import std.types { + Int, + List, +} +import std.measure { + ByteSize, + byte_size, + byte_size_count, + bit_width, + watt, + watt_count, + hardware_thread_count, + hertz, + money_amount_micro, +} +import product.hardware_selection { + milliwatt, + Platform, + MemoryConfig, + CpuCandidate, + Motherboard, + PsuModel, + EfficiencyRating, + SystemConfig, + HardwareAxes, + effective_data_rate_mts, + config_axes, + wall_draw_watts, + psu_is_adequate, + dominates, + axes_on_front, + config_is_realizable, + cost_micros_per_gib, + bandwidth_per_watt, +} +import extdeps.cpu.types { + CpuModelCatalogRow, + CpuSocket, + SocketPackage, +} +import extdeps.cpu.ampere { + ampere_altra_l1_cache_citations, + ampere_altra_l1_cache_geometry, + ampere_altra_l2_cache_citations, + ampere_altra_l2_cache_geometry, + ampere_altra_max_l3_cache_citations, + ampere_altra_max_l3_cache_geometry, +} +import extdeps.toolchain.types { Architecture } +import extdeps.memory.types { + DimmBuffering, + DramModuleCatalogRow, + dram_module_is_realizable, + dram_module_required_die_density, + dram_generation_ddr4, +} +import extdeps.vendor.sk_hynix { sk_hynix } +import extdeps.vendor.ampere { ampere } +import extdeps.memory.jedec { + ddr4_generation_catalog, + jedec_ddr_generation_catalog_row, +} +import std.pareto { + verdict_dominates, + verdict_is_incomparable, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/hermetic_fixture_realization_test.dag b/dag/test/claim/hermetic_fixture_realization_test.dag index 0422427564b..e6e3b4e2f45 100644 --- a/dag/test/claim/hermetic_fixture_realization_test.dag +++ b/dag/test/claim/hermetic_fixture_realization_test.dag @@ -1,4 +1,32 @@ module test.claim.hermetic_fixture_realization +import std.types { + Bool, + ContentHash, +} +import std.cache_identity { hermetic_fixture_artifact_kind } +import std.cache_interface { + ArtifactIdentity, + ContentAddressedByValue, + PerHostFilesystem, + InProcess, + StructuredArtifact, + MissIsDiagnostic, +} +import extdeps.cache { + cache_interface_facts_from_catalog, + cache_key_projection_transport, +} +import extdeps.cache.types { catalog_key_derivation_classification } +import extdeps.realization.hermetic_fixture { + hermetic_fixture_file_facts, + hermetic_fixture_in_process_facts, + hermetic_fixture_file_store_id, + hermetic_fixture_in_process_id, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/hetzner_cost_quote_witness_test.dag b/dag/test/claim/hetzner_cost_quote_witness_test.dag index f7f8137167b..a8fb2c65aa2 100644 --- a/dag/test/claim/hetzner_cost_quote_witness_test.dag +++ b/dag/test/claim/hetzner_cost_quote_witness_test.dag @@ -1,4 +1,19 @@ module test.claim.hetzner_cost_quote_witness +import std.bit { Bool } +import std.nat { Nat } +import extdeps.cloud.hetzner { cax41_catalog } +import gunbc.ci_fleet { + per_second_billed_cost_quote, + cost_estimate_unit_price_micros, + PerSecondBilled, + OwnedMarginalZero, + Metered, + DeveloperAttention, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_allocation_conservation_test.dag b/dag/test/claim/host_allocation_conservation_test.dag index dc530d401ac..9ba65b12109 100644 --- a/dag/test/claim/host_allocation_conservation_test.dag +++ b/dag/test/claim/host_allocation_conservation_test.dag @@ -1,5 +1,16 @@ module test.claim.host_allocation_conservation - +import std.bit { Bool } +import std.measure { byte_size } +import gunbc.fleet_host_budget { + host_allocation_conserves, + max_concurrent_sessions, + session_pool_bytes, + gunbc_runner_pool_budget, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_build_cache_provision_design_witness_test.dag b/dag/test/claim/host_build_cache_provision_design_witness_test.dag index 8af258ac1f1..b55ce03a52f 100644 --- a/dag/test/claim/host_build_cache_provision_design_witness_test.dag +++ b/dag/test/claim/host_build_cache_provision_design_witness_test.dag @@ -1,4 +1,34 @@ module test.claim.host_build_cache_provision_design +import std.bit { Bool } +import extdeps.cache.sccache { sccache_local_id } +import extdeps.cache.github_actions { gha_actions_cache_id } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import gunbc.host_effect { ProvisionBuildCache } +import gunbc.host_build_cache_catalog_gate { + provision_build_cache_catalog_gate_verdict, + provision_build_cache_unknown_catalog_fixture, + ProvisionBuildCacheCatalogRealizable, + ProvisionBuildCacheCatalogRefused, +} +import gunbc.host_build_cache_provision_script { build_cache_provision_read_back_fails_closed } +import gunbc.host_build_cache_provision { + provision_build_cache_default_effect, + provision_build_cache_routes_through_host_effect_apply, + daemon_absent_refuses_fail_closed, + misconfigured_matches_cited_fragment, + provision_build_cache_verdict, + provision_build_cache_absorbing_fallback_widen_sketch, + build_cache_provision_gate_accepts, + DaemonAbsent, + DaemonStatsOk, + ProvisionConverged, + ProvisionRefused, + RefusalCatalogUnknown, + RefusalDaemonAbsent, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_converge_delta_witness_test.dag b/dag/test/claim/host_converge_delta_witness_test.dag index d5e564c342b..b78b77397ba 100644 --- a/dag/test/claim/host_converge_delta_witness_test.dag +++ b/dag/test/claim/host_converge_delta_witness_test.dag @@ -1,4 +1,56 @@ module test.claim.host_converge_delta_witness +import std.types { + Bool, + String, + List, +} +import std.measure { + byte_size, + byte_size_count, + hardware_thread_count, +} +import std.change { + KeyedApplyHunk, + KeyedConflict, + KeyedLeafVerdictFold, + keyed_leaf_verdict_fold, +} +import gunbc.ci_runner_placement { + RunnerHostDeployment, + BatchLatencyTolerant, +} +import extdeps.github.actions { SelfHosted } +import gunbc.host_converge { + ConvergeKnob, + ConvergeSlice, + RunnerSlice, + PerSlotMemoryCap, + SliceProperty, + legacy_converge_knob, + runner_host_knobs, + runner_instance_glob, + gunbc_runner_per_slot_dropin_path, + gunbc_runner_per_slot_swap_dropin_path, +} +import extdeps.systemd { + systemd_memory_max_property, + systemd_memory_swap_max_property, +} +import gunbc.host_converge_delta { + ConvergeKnobKey, + converge_knob_key, + converge_knob_values_equal, + host_converge_three_way_patch, + host_converge_two_way_diff, + host_converge_patch_hunk_count, + host_converge_knob_in_patch, + host_converge_knob_verdict, + host_converge_three_way_entry_count, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_converge_realize_witness_test.dag b/dag/test/claim/host_converge_realize_witness_test.dag index 17621a68f9d..5d282293ead 100644 --- a/dag/test/claim/host_converge_realize_witness_test.dag +++ b/dag/test/claim/host_converge_realize_witness_test.dag @@ -1,4 +1,38 @@ module test.claim.host_converge_realize_witness +import std.bit { Bool } +import std.types { String } +import gunbc.host_converge_realize { + interpret_converge_knob, + interpret_host_converge, + ConvergeHostInterpreted, + converge_target_kind_label, +} +import gunbc.host_converge { + ConvergeKnob, + HostConverge, + GunbcSlice, + FreshStandup, + BlindApply, + GunbcPinnedTree, + DeferToSubmodule, + NoMembershipProbe, + gunbc_pinned_tree_desired_label, + gunbc_root_env_key, + gunbc_host_gunbc_root_path, + gunbc_dag_root_submodule_path, + gunbc_host_ctrl_checkout_path, + gunbc_ctrl_read_pin_script, + gunbc_pinned_binary_provenance_policy, + gunbc_green_place_marker_spec, + gunbc_dashboard_live_apply_policy, + SliceProperty, +} +import extdeps.systemd { systemd_memory_max_property } +import gunbc.fleet_intent_network { operator_host_srv3 } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_effect_apply_witness_test.dag b/dag/test/claim/host_effect_apply_witness_test.dag index dbdbc42e275..d04bdc58b8e 100644 --- a/dag/test/claim/host_effect_apply_witness_test.dag +++ b/dag/test/claim/host_effect_apply_witness_test.dag @@ -1,4 +1,67 @@ module test.claim.host_effect_apply_witness +import std.bit { Bool } +import std.types { NonEmptyStr } +import gunbc.host_effect { + HostEffect, + RedfishAction, + ConvergePlan, + NodeControlPlane, + BmcController, + Drive, + OneShot, + ConvergeLoop, + host_effect_identity_evidence, + host_effect_converge_loop_evidence, + host_effect_drive_from_evidence, + SshShell, +} +import gunbc.host_effect_realize { + host_effect_apply, + host_effect_drive_directive, + ConvergeDirective, + Settled, + ReDrive, + Refused, +} +import std.realization_reconcile { + Reconciliation, + reconciliation_converged, + NotConverged, +} +import std.effects { + IdempotencyEvidence, + LatticeEffect, + NonIdempotent, + AppendEffect, +} +import gunbc.host_converge { + HostConverge, + ConvergeKnob, + GunbcSlice, + FreshStandup, + BlindApply, + GunbcPinnedTree, + DeferToSubmodule, + NoMembershipProbe, + gunbc_pinned_tree_desired_label, + gunbc_root_env_key, + gunbc_host_gunbc_root_path, + gunbc_dag_root_submodule_path, + gunbc_host_ctrl_checkout_path, + gunbc_ctrl_read_pin_script, + gunbc_pinned_binary_provenance_policy, + gunbc_green_place_marker_spec, + gunbc_dashboard_live_apply_policy, +} +import gunbc.fleet_intent { srv1_host } +import extdeps.bmc.types { + RedfishSystemAction, + GetSystem, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_hygiene_liveness_test.dag b/dag/test/claim/host_hygiene_liveness_test.dag index c62fdd4b7fc..40a96f9f9b0 100644 --- a/dag/test/claim/host_hygiene_liveness_test.dag +++ b/dag/test/claim/host_hygiene_liveness_test.dag @@ -1,4 +1,23 @@ module test.claim.host_hygiene_liveness +import gunbc.host_hygiene_liveness { + ListeningFresh, + ListeningNeverSeen, + ListeningObserved, + SlotListeningObservation, + fleet_green_from_listening, + ground_fleet_listening, + slot_listening_verdict, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import std.types { NonEmptyStr } +import std.measure { + Second, + second, +} +import gunbc.host_hygiene_liveness_script { host_hygiene_liveness_reads_listening_for_jobs_line } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_hygiene_reaper_test.dag b/dag/test/claim/host_hygiene_reaper_test.dag index 8e5a5e6854c..16b5030faaa 100644 --- a/dag/test/claim/host_hygiene_reaper_test.dag +++ b/dag/test/claim/host_hygiene_reaper_test.dag @@ -1,4 +1,30 @@ module test.claim.host_hygiene_reaper +import extdeps.systemd { + Active, + Failed, + Inactive, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import std.types { NonEmptyStr } +import gunbc.host_hygiene_reaper { + CgroupBuildCacheServerOccupant, + CgroupEmpty, + CgroupOrdinaryProcesses, + ResidualSlotObservation, + action_kills_build_cache_server, + collect_exempt_causes, + ground_residual_reap, + residual_reap_action, + residual_reap_action_absorbing_fallback_widen_sketch, +} +import gunbc.host_hygiene_reaper_script { + host_hygiene_reap_refuses_build_cache_occupant, + host_hygiene_reap_removes_only_disabled_overrides, + host_hygiene_reap_skips_active_units, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_identity_observation_witness_test.dag b/dag/test/claim/host_identity_observation_witness_test.dag index 061d1704dfb..04a3a1c9876 100644 --- a/dag/test/claim/host_identity_observation_witness_test.dag +++ b/dag/test/claim/host_identity_observation_witness_test.dag @@ -1,4 +1,90 @@ module test.claim.host_identity_observation_witness +import std.types { + Bool, + String, + NonEmptyStr, +} +import gunbc.fleet_intent { + srv1_host, + srv2_host, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import extdeps.dns.domain_name { + DnsLabel, + parse_dns_label_raw, +} +import std.error_primitives { + Ok, + Err, +} +import gunbc.host_effect { + NodeControlPlane, + host_effect_identity_evidence, + SshShell, + EmitArtifactThenThinRun, +} +import gunbc.host_effect_realize { host_effect_apply } +import std.realization_reconcile { reconciliation_converged } +import gunbc.host_identity_observation { + HostIdentityObservationRow, + gunbc_srv1_host_identity_observation_fixture_row, + gunbc_srv2_host_identity_observation_fixture_row, + host_identity_observation_from_stdout, + host_identity_observation_apply, + host_identity_observation_from_apply, + host_identity_observation_nonempty, + fixture_host_identity_observation, + fixture_host_identity_observation_srv2, +} +import gunbc.deployed_intent_v0 { + gunbc_srv1_deployed_intent_v0_persisted, + gunbc_srv2_deployed_intent_v0_persisted, + deployed_intent_observed_differs_from_fleet_slot, + deployed_intent_observed_short_hostname, + deployed_intent_v0_from_observation_row, +} +import gunbc.host_identity_adopt { + srv1_host_identity_ssh_transport, + host_identity_transport_label, + host_identity_adopt_receipt, + host_identity_adopt_receipt_is_valid, + host_identity_adopt_model_hash, +} +import std.change { KeyedApplyHunk } +import gunbc.host_identity_knob { + host_identity_knob_key, + three_way_leaf, + host_identity_knob_value, + host_identity_patch_from_intents, +} +import gunbc.host_identity_converge { + ApplyPlan, + host_identity_precondition_verdict, + host_identity_precondition_is_conflict, + host_identity_precondition_permits_apply, + host_identity_precondition_is_noop, + host_identity_plan_from_verdict, + host_identity_apply_gated, + host_identity_unprivileged_refusal_has_no_marker, + host_identity_read_back_matches, +} +import gunbc.deployed_intent_v1 { + gunbc_srv1_deployed_intent_v1, + deployed_intent_v1_desired_hostname_short, +} +import gunbc.host_identity_assimilation { + HostIdentityAssimilationTarget, + host_identity_converge_with_observation, +} +import gunbc.host_identity_access { host_identity_srv1_access } +import gunbc.ci_deploy_access { deploy_access_unprivileged_fixture_actor } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_network_diagnosis_witness_test.dag b/dag/test/claim/host_network_diagnosis_witness_test.dag index f23618a143e..2c01b39df74 100644 --- a/dag/test/claim/host_network_diagnosis_witness_test.dag +++ b/dag/test/claim/host_network_diagnosis_witness_test.dag @@ -1,4 +1,30 @@ module test.claim.host_network_diagnosis +import extdeps.netplan.netplan { + InterfaceObservation, + interface_is_configured, + netplan_file_is_applied, +} +import v2.std.live_tree { LiveTreeDisposition } +import extdeps.cloud_init.cloud_init { cloud_init_is_disabled } +import gunbc.host_network_diagnosis { + diagnose_host_network, + diagnose_via_generator_state_widen_sketch, + diagnosis_blames_configuration, + diagnosis_blames_physical_layer, + diagnosis_gate_accepts, + diagnosis_is_reboot_stable, + host_network_fleet_unobserved_count, + netplan_file_ownership, + network_diagnosis_verdict, + srv4_cloud_init_disposition, + srv4_lan_interface, + srv4_netplan_config, + srv4_unused_port, +} +import gunbc.host_phase_status { + fleet_subsumption_hosts, + observation_verdict_eq, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_phase_status_witness_test.dag b/dag/test/claim/host_phase_status_witness_test.dag index 61dddeea154..00b10a90f36 100644 --- a/dag/test/claim/host_phase_status_witness_test.dag +++ b/dag/test/claim/host_phase_status_witness_test.dag @@ -1,4 +1,39 @@ module test.claim.host_phase_status +import std.decl_ref { DeclarationRef } +import gunbc.host_standup { + DeclaredGap, + ModeledCompose, + PhaseDisposition, + host_standup_gap_phase_count, + host_standup_spine, +} +import product.placement_supply { HostIdentity } +import gunbc.host_phase_status { + HostPhaseCell, + HostPhaseCellStatus, + fleet_subsumption_hosts, + host_fleet_phase_matrix, + host_phase_cell_has_live_producer, + host_phase_cell_is_converged, + host_phase_cell_is_modeled, + host_phase_finished_cell_count, + host_phase_observation_coverage_count, + host_phase_reconcile, + host_phase_remaining_work_count, + host_phase_unmodeled_count, + host_phase_verdict_absorbing_fallback_widen_sketch, + host_phase_verdict_from, + host_phase_verdict_gate_accepts, + observation_verdict_eq, +} +import v2.std.live_tree { LiveTreeDisposition } +import std.upsert_decision { ObservationVerdict } +import gunbc.membership_reconcile { + membership_refusal_count, + membership_teardown_count, + membership_upsert_count, +} +import gunbc.fleet_intent_network { operator_host_srv3 } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_standup_assimilation_deduction_witness_test.dag b/dag/test/claim/host_standup_assimilation_deduction_witness_test.dag index 308109a7aad..58b75044d04 100644 --- a/dag/test/claim/host_standup_assimilation_deduction_witness_test.dag +++ b/dag/test/claim/host_standup_assimilation_deduction_witness_test.dag @@ -1,5 +1,71 @@ module test.claim.host_standup_assimilation_deduction - +import std.types { + Bool, + List, +} +import std.measure { + Millisecond, + millisecond, + millisecond_count, +} +import std.upsert_decision { + Converged, + Absent, + Drifted, + UnknownRefused, + Apply, + Refuse, + Noop, + UpsertClassification, +} +import std.temporal_effect { + StallBudgetVerdict, + StallWithinBudget, + StallBudgetExceeded, + stall_budget_verdict, +} +import extdeps.bmc.types { BootOverrideModeUefi } +import gunbc.os_install_deduction { SubiquityStorageScreen } +import gunbc.srv3_os_install_diagnostic { srv3_install_hang_no_router_lease_ms } +import gunbc.host_standup_assimilation_deduction { + hang_budget_millisecond, + srv3_os_install_to_host_identity_budget, + AssertOsInstallActuationPending, + StallTransitionProbe, + StallCauseBootModeLegacyUefiRequired, + StallCauseMediaNeverAttached, + StallCauseSeedNotFoundAwaitingStorage, + StallCauseConsoleRedirectOff, + StallCauseNoBootableDevice, + RemediationSetBootOverrideModeUefi, + RemediationStartNbdServeSession, + RemediationRemasterSeedOrDeclareStoragePolicy, + srv3_pre_install_actuation_verdict, + srv3_post_install_actuation_verdict, + srv3_unreadable_lease_actuation_verdict, + deduce_os_install_actuated_satisfied, + decision_for_os_install_actuation_verdict, + classify_os_install_actuation_upsert, + srv3_pre_install_lease_observation, + srv3_unreadable_lease_observation, + stall_causes_from_probe, + cause_fold_primary_stall_remediation, + stall_transition_cause_label, +} +import gunbc.fleet_intent_network { operator_host_srv3 } +import gunbc.host_standup { + host_standup_gap_count_at_actuation_verdict, + host_standup_step_is_effective_gap_at_actuation_verdict, + host_standup_spine, + Prefix, + OsInstallActuated, + Assimilation, + HostIdentityConverge, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_standup_spine_witness_test.dag b/dag/test/claim/host_standup_spine_witness_test.dag index f4683590d2e..246ff13830e 100644 --- a/dag/test/claim/host_standup_spine_witness_test.dag +++ b/dag/test/claim/host_standup_spine_witness_test.dag @@ -1,5 +1,80 @@ module test.claim.host_standup_spine - +import std.bit { Bool } +import std.types { Int } +import std.measure { millisecond } +import gunbc.host_standup { + host_standup_spine, + host_standup_spine_length, + host_standup_gap_count, + host_standup_gap_count_at_actuation_verdict, + host_standup_gap_ledger, + srv3_host_standup_target, + srv3_install_mechanism_is_nbd_proxy_no_fallback, + credential_probe_maps_factory_default, + credential_probe_maps_credentials_rotated, + host_standup_fleet_converge_policy, + assimilation_complete, + assimilation_complete_all_satisfied, + AssimilationCompleteGate, + AssimilationComplete, + AssimilationIncomplete, + InputSatisfied, + InputGap, + InputRefused, + NodeRegistered, + ResourcesPresent, + RunnerSlotHealthy, + GreenPlacePinCoherent, + GreenPlacePinCoherentWitness, + GreenPlaceFromGunbcGate, + GreenPlacePinGap, + GreenPlacePinRefused, + host_standup_p5_green_place_noop_gate_authority, + host_standup_p5_green_place_marker_gate_authority, + host_standup_p5_desired_pin_authority, + host_standup_p5_default_green_place_gate_verdict, + green_place_pin_coherent_satisfied, + host_standup_p3_fail_closed_blocks_complete, + host_standup_p3_gunbc_pinned_tree_landed, + host_standup_default_assimilation_gate_unsatisfied, + HostStandupStep, + Prefix, + Assimilation, + BmcCredentialConverge, + OsInstallMechanismResolved, + OsInstallActuated, + HostConvergePolicyDerived, + HostIdentityConverge, + ReachSecretsNetwork, + RunnerDeploySlot, + BuildCacheProvision, + ComputeFabricEnroll, + GreenPlaceReadiness, + SessionPlacementEnrollment, + StandupAssimilationComplete, + DeclaredGap, + ModeledCompose, +} +import gunbc.bmc_onboarding { + FactoryCredentialActive, + RotatedCredentialActive, +} +import gunbc.fleet_intent_network { operator_host_srv3 } +import std.upsert_decision { Converged } +import gunbc.host_standup_assimilation_deduction { srv3_post_install_actuation_verdict } +import gunbc.ci_fleet { + fleet_intent_offers, + srv3_offer, +} +import gunbc.host_converge { + ConvergePolicyDerived, + ConvergePolicyUnsound, +} +import product.compute_fabric { witness_fabric_binds_need_to_opportunity } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_swap_backing_witness_test.dag b/dag/test/claim/host_swap_backing_witness_test.dag index 92a3390a4cc..0b6fca01d75 100644 --- a/dag/test/claim/host_swap_backing_witness_test.dag +++ b/dag/test/claim/host_swap_backing_witness_test.dag @@ -1,4 +1,23 @@ module test.claim.host_swap_backing +import v2.std.live_tree { LiveTreeDisposition } +import extdeps.tools.free { SwapStats } +import std.measure { + byte_size, + byte_size_count, +} +import gunbc.host_phase_status { + fleet_subsumption_hosts, + observation_verdict_eq, +} +import gunbc.runner_slot_allocation { gunbc_runner_slot_desired } +import gunbc.host_swap_backing { + host_swap_backing_fleet_unobserved_count, + host_swap_backing_requirement, + host_swap_backing_verdict, + swap_cap_verdict_backing_blind_widen_sketch, + swap_cap_verdict_gate_accepts, + swap_cap_verdict_qualified_by_backing, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/host_toolchain_components_witness_test.dag b/dag/test/claim/host_toolchain_components_witness_test.dag index 48064c31637..c949e46febc 100644 --- a/dag/test/claim/host_toolchain_components_witness_test.dag +++ b/dag/test/claim/host_toolchain_components_witness_test.dag @@ -1,4 +1,35 @@ module test.claim.host_toolchain_components +import v2.std.live_tree { LiveTreeDisposition } +import gunbc.host_toolchain_components { + NotReachableOnSpawnPath, + ReachableOnSpawnPath, + floor_gate_component_requirements, + gate_finds_component_verdict, + host_gate_finds_component_verdict, + host_toolchain_completeness_verdict, + resolved_toolchain_has, + resolved_toolchain_missing, + rustup_component_add_on_miss_probe_sketch, + rustup_component_list_probe, + srv2_ghrunner_pinned_toolchain_has_rustfmt, + srv2_ghrunner_toolchain_after_fix, + srv2_ghrunner_toolchain_before_fix, + toolchain_completeness_fleet_unobserved_count, + toolchain_completeness_observed_verdict, + toolchain_completeness_verdict, +} +import gunbc.host_phase_status { + fleet_subsumption_hosts, + observation_verdict_eq, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import extdeps.rustup { + rustup_component_eq, + rustup_component_name, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/html_emit_witness_test.dag b/dag/test/claim/html_emit_witness_test.dag index 6b8c8352da6..cbf68aa4241 100644 --- a/dag/test/claim/html_emit_witness_test.dag +++ b/dag/test/claim/html_emit_witness_test.dag @@ -1,12 +1,17 @@ module test.claim.html_emit_witness - -import std.markup { Fragment, Element, FragmentText, attr } +import std.markup { + Element, + Fragment, + FragmentText, + attr, +} import extdeps.languages.html { - try_serialize_html_source, - serialize_html_source, EmitOk, EmitRejected, + serialize_html_source, + try_serialize_html_source, } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/html_markup_xss_witness_test.dag b/dag/test/claim/html_markup_xss_witness_test.dag index 96fbc7a1537..3caddd48fe6 100644 --- a/dag/test/claim/html_markup_xss_witness_test.dag +++ b/dag/test/claim/html_markup_xss_witness_test.dag @@ -1,16 +1,26 @@ module test.claim.html_markup_xss_witness - -import std.markup { Fragment, Element, FragmentText, attr, escape_url } +import std.markup { + Element, + Fragment, + FragmentText, + attr, + escape_url, +} import extdeps.uri_validation { - validate_href, - SafeHref, - RejectedHref, DangerousScheme, - JavascriptScheme, DataScheme, + JavascriptScheme, + RejectedHref, + SafeHref, SchemeNotAllowlisted, + validate_href, +} +import extdeps.languages.html { + EmitOk, + EmitRejected, + try_serialize_html_source, } -import extdeps.languages.html { try_serialize_html_source, EmitOk, EmitRejected } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/html_roundtrip_test.dag b/dag/test/claim/html_roundtrip_test.dag index 1b3849bac38..44fd8c9d7b4 100644 --- a/dag/test/claim/html_roundtrip_test.dag +++ b/dag/test/claim/html_roundtrip_test.dag @@ -1,17 +1,26 @@ module test.claim.html_roundtrip - -import std.markup { Fragment, Element, FragmentText, attr, MarkupBracket } +import std.markup { + Element, + Fragment, + FragmentText, + MarkupBracket, + attr, +} import extdeps.languages.html { - serialize_html_source, - serialize_html_source_with, - ingest_html_source, - ingest_html_source_with, - IngestedNode, IngestRejected, - html_medium_lossless, + IngestedNode, canonical_html_spellings, + html_medium_lossless, + ingest_html_source, + ingest_html_source_with, + serialize_html_source, + serialize_html_source_with, +} +import extdeps.communication.medium { + Lossless, + Lossy, } -import extdeps.communication.medium { Lossless, Lossy } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/infer_occurrence_binding_scaffold_witness_test.dag b/dag/test/claim/infer_occurrence_binding_scaffold_witness_test.dag new file mode 100644 index 00000000000..002afb59cbe --- /dev/null +++ b/dag/test/claim/infer_occurrence_binding_scaffold_witness_test.dag @@ -0,0 +1,33 @@ +module test.claim.infer_occurrence_binding_scaffold_witness_test + +import std.disposition { Scaffold, SingleAuthority } +import gunbc.infer_occurrence_binding_scaffold { + infer_occurrence_binding_v1_adapter_scaffold, + infer_occurrence_binding_v1_adapter_dissolve_trigger, + infer_occurrence_binding_v1_adapter_receipt_plan_anchor, +} + +test fn infer_occurrence_binding_v1_adapter_scaffold_is_seed_retained() -> Bool { + match infer_occurrence_binding_v1_adapter_scaffold { + Scaffold { dissolves_to: SingleAuthority, bind: _ } => true + _ => false + } +} + +test fn infer_occurrence_binding_v1_adapter_dissolve_trigger_names_authority_and_lane() -> Bool { + string_contains( + s: infer_occurrence_binding_v1_adapter_dissolve_trigger, + pattern: "module_path_binding_decide", + ) && + string_contains( + s: infer_occurrence_binding_v1_adapter_dissolve_trigger, + pattern: "namespace-canonical-binding", + ) +} + +test fn infer_occurrence_binding_v1_adapter_receipt_plan_anchor_is_checkable() -> Bool { + string_contains( + s: infer_occurrence_binding_v1_adapter_receipt_plan_anchor, + pattern: "namespace-unique-on-chain-operational-plan.md", + ) +} diff --git a/dag/test/claim/input_envelope_admission_test.dag b/dag/test/claim/input_envelope_admission_test.dag index d1fa6b410d8..d685e66ea00 100644 --- a/dag/test/claim/input_envelope_admission_test.dag +++ b/dag/test/claim/input_envelope_admission_test.dag @@ -1,5 +1,25 @@ module test.claim.input_envelope_admission - +import gunbc.ci_input_envelope { + InputSizeAxis, + WitnessCount, + SourceNodeCount, + CorpusNodeCount, + InputBound, + InputEnvelope, + BoundedInput, + EnvelopeUnknown, + AdmissionVerdict, + Admitted, + RefusedOverEnvelope, + RefusedUndeclared, + input_admitted, + gunbc_ci_corpus_envelope, +} +import std.measure { Measure } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/interp_recorded_fixture_witness_test.dag b/dag/test/claim/interp_recorded_fixture_witness_test.dag index 3c0b7622869..c4e4f0afdff 100644 --- a/dag/test/claim/interp_recorded_fixture_witness_test.dag +++ b/dag/test/claim/interp_recorded_fixture_witness_test.dag @@ -1,5 +1,10 @@ module test.claim.interp_recorded_fixture_witness_test - +import tools.interp_recorded_fixture_witness_transport { run_interp_recorded_fixture_witness } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/interpreter_kernel_model_witness_test.dag b/dag/test/claim/interpreter_kernel_model_witness_test.dag index d4210d3b6b4..4ae3dbb73de 100644 --- a/dag/test/claim/interpreter_kernel_model_witness_test.dag +++ b/dag/test/claim/interpreter_kernel_model_witness_test.dag @@ -1,4 +1,20 @@ module test.claim.interpreter_kernel_model_witness +import gunbc.interpreter_kernel_model { + PureEvalAuthority, + PinnedHostPhysics, + v1_interpreter_hybrid_seed_file, + is_pure_eval_authority_module, + is_pinned_host_physics_stage0_file, + interpreter_kernel_d_phase_is_pure_eval_emit_wired, + v1_interpreter_not_classified_as_pinned_host_physics, + seam_class_for_authority_module, + seam_class_for_pinned_basename, + hybrid_seed_file_is_seam_unclassified, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/jedec_ddr_generation_witness_test.dag b/dag/test/claim/jedec_ddr_generation_witness_test.dag index 85a24abc824..a939bab325a 100644 --- a/dag/test/claim/jedec_ddr_generation_witness_test.dag +++ b/dag/test/claim/jedec_ddr_generation_witness_test.dag @@ -1,4 +1,29 @@ module test.claim.jedec_ddr_generation +import std.bit { Bool } +import std.measure { + byte_size, + byte_size_count, + bit_width, +} +import extdeps.memory.types { + DimmBuffering, + DoubleDataRate, + DramModuleCatalogRow, + dram_module_is_realizable, + dram_generation_ddr4, + dram_generation_ddr5, + dram_generation_eq, +} +import extdeps.memory.jedec { + ddr4_generation_catalog, + ddr5_generation_catalog, + jedec_ddr_generation_catalog_row, +} +import extdeps.vendor.sk_hynix { sk_hynix } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/js_site_emit_test.dag b/dag/test/claim/js_site_emit_test.dag index 774bc4eed2b..bdd50c388ce 100644 --- a/dag/test/claim/js_site_emit_test.dag +++ b/dag/test/claim/js_site_emit_test.dag @@ -1,4 +1,34 @@ module test.claim.js_site_emit +import examples.js_site { + JsSitePage, + js_site_pages, + js_site_page_count, + Home, + About, + Browse, +} +import examples.js_site_emit { + js_site_emit_html, + js_site_emit_tsx, + js_site_page_html, + js_site_page_tsx, + js_site_html_artifact_path, + js_site_tsx_artifact_path, +} +import gunbc.gunbhub_serve { gunbhub_hostile_page } +import extdeps.languages.html { + EmitOk, + EmitRejected, +} +import extdeps.languages.react_jsx { + JsxOk, + JsxRejected, +} +import extdeps.filesystem.filesystem_io { Filesystem } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/json_emit_corpus_witness.dag b/dag/test/claim/json_emit_corpus_witness.dag index 9194cf71b42..98c5b22219c 100644 --- a/dag/test/claim/json_emit_corpus_witness.dag +++ b/dag/test/claim/json_emit_corpus_witness.dag @@ -1,5 +1,11 @@ module test.claim.json_emit_corpus_witness +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import extdeps.filesystem.filesystem_io data json_grammar_path: String = "dag/extdeps/languages/json/grammar.dag" data json_emit_path: String = "dag/extdeps/languages/json/emit.dag" diff --git a/dag/test/claim/json_emit_witness_test.dag b/dag/test/claim/json_emit_witness_test.dag index 240b4c9a5e6..a2957ee0d54 100644 --- a/dag/test/claim/json_emit_witness_test.dag +++ b/dag/test/claim/json_emit_witness_test.dag @@ -1,4 +1,32 @@ module test.claim.json_emit_witness +import extdeps.external_authority { ExternalAuthority } +import extdeps.languages.json.emit { + extdeps_external_authority_anchor, + escape_json_string, + quote_json_string, + serialize_json, + json_null, + json_bool, + json_int, + json_string, + json_array, + json_object, + json_kv, + json_int_list, + json_str_list, + json_unicode_escape_hex4, + json_number_from_lexeme_string, +} +import extdeps.languages.json.grammar { + json_production_rows, + json_number_lexeme_valid, + json_number_lexeme, + json_int_lexeme, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/keyed_delta_fold_witness_test.dag b/dag/test/claim/keyed_delta_fold_witness_test.dag index 44f9ae279c2..7a235fd6b25 100644 --- a/dag/test/claim/keyed_delta_fold_witness_test.dag +++ b/dag/test/claim/keyed_delta_fold_witness_test.dag @@ -1,4 +1,42 @@ module test.claim.keyed_delta_fold_witness +import std.types { + Bool, + String, + List, +} +import std.change { + KeyedRow, + KeyedPatch, + KeyedLeafVerdict, + KeyedApplyHunk, + KeyedVerdictAdded, + KeyedVerdictRemoved, + KeyedConflict, + KeyedUnchanged, + keyed_three_way_leaf, + keyed_two_way_diff, + keyed_three_way_fold, + keyed_apply_two_way_diff, + keyed_retract_two_way_diff, + keyed_apply_patch, + keyed_invert_patch, + keyed_patch_empty, + keyed_patch_append, + keyed_patch_singleton, + keyed_patch_monoid, + keyed_patch_fold, + keyed_three_way_patch_empty, + keyed_three_way_patch_monoid, + keyed_three_way_patch_singleton, + keyed_leaf_verdict_join, + keyed_patches_equal, + keyed_rows_snapshot_equal, + keyed_patch_hunk_count, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/layout_render_witness_test.dag b/dag/test/claim/layout_render_witness_test.dag index 7bc4ce182d8..3d9d4caaf57 100644 --- a/dag/test/claim/layout_render_witness_test.dag +++ b/dag/test/claim/layout_render_witness_test.dag @@ -1,4 +1,23 @@ module test.claim.layout_render_witness +import std.layout { + Doc, + DocEmpty, + DocText, + DocLine, + DocConcat, + DocNest, + LayoutProtocol, + doc_text, + doc_concat, + doc_nest, + doc_line_of, + doc_blank, + render, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/lens_verdict_witness_test.dag b/dag/test/claim/lens_verdict_witness_test.dag index 3cc7fb12472..2a5c168b59d 100644 --- a/dag/test/claim/lens_verdict_witness_test.dag +++ b/dag/test/claim/lens_verdict_witness_test.dag @@ -1,4 +1,17 @@ module test.claim.lens_verdict_witness +import v2.std.lens_verdict { + Holds, + LensVerdict, + Unrealized, + Violation, + lens_verdict_diagnostic_locus_module, + lens_verdict_module_unrealized, + lens_verdict_module_violation, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/long/import_closure_live_test.dag b/dag/test/claim/long/import_closure_live_test.dag index e1cbc6646e1..c3dd1c55b68 100644 --- a/dag/test/claim/long/import_closure_live_test.dag +++ b/dag/test/claim/long/import_closure_live_test.dag @@ -1,6 +1,7 @@ module test.claim.long.import_closure_live - import v2.lens.module_graph { no_paths } +import v2.std.live_tree { LiveTreeDisposition } +import gunbc.ci_layer_roots { witness_layer_roots } data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree diff --git a/dag/test/claim/long/inert_lens_hygiene_witness_test.dag b/dag/test/claim/long/inert_lens_hygiene_witness_test.dag index 8449ee8cee7..d7d5d3e438c 100644 --- a/dag/test/claim/long/inert_lens_hygiene_witness_test.dag +++ b/dag/test/claim/long/inert_lens_hygiene_witness_test.dag @@ -1,5 +1,12 @@ module test.claim.long.inert_lens_hygiene_witness - +import v2.lens.inert_lens { + inert_lens_hygiene_has_no_unreached_modules_holds, + inert_lens_hygiene_universe_is_nonempty_holds, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/long/reference_closure_equivalence_test.dag b/dag/test/claim/long/reference_closure_equivalence_test.dag index 6b1d12759ed..7f1ddeb4724 100644 --- a/dag/test/claim/long/reference_closure_equivalence_test.dag +++ b/dag/test/claim/long/reference_closure_equivalence_test.dag @@ -1,6 +1,9 @@ module test.claim.long.reference_closure_equivalence - -import v2.lens.module_graph { no_paths, module_graph_exclude_substrings } +import v2.lens.module_graph { + module_graph_exclude_substrings, + no_paths, +} +import gunbc.ci_layer_roots { witness_layer_roots } data expected_conformance_closure: FreeMonoid = [ "dag/test/claim/module_graph/conformance_imports_only.dag", diff --git a/dag/test/claim/map_lookup_dual_dispatch_witness_test.dag b/dag/test/claim/map_lookup_dual_dispatch_witness_test.dag index 22363435497..9058c062b24 100644 --- a/dag/test/claim/map_lookup_dual_dispatch_witness_test.dag +++ b/dag/test/claim/map_lookup_dual_dispatch_witness_test.dag @@ -1,5 +1,14 @@ module test.claim.map_lookup_dual_dispatch_witness_test - +import std.graph { + CallGraph, + GraphEdge, + build_adjacency_views, +} +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/markdown_inline_render_test.dag b/dag/test/claim/markdown_inline_render_test.dag index e890df6312a..6f3e4d6f194 100644 --- a/dag/test/claim/markdown_inline_render_test.dag +++ b/dag/test/claim/markdown_inline_render_test.dag @@ -1,12 +1,17 @@ module test.claim.markdown_inline_render - -import std.markup { Fragment, Element, FragmentText, attr } +import std.markup { + Element, + Fragment, + FragmentText, + attr, +} import std.markdown { - markdown_inlines_to_fragments, - markdown_inline_to_fragments, ImageInline, + markdown_inline_to_fragments, + markdown_inlines_to_fragments, } import extdeps.languages.markdown { parse_inline_markdown_minimal } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/markdown_markup_xss_witness_test.dag b/dag/test/claim/markdown_markup_xss_witness_test.dag index 3dab790e579..22455db5aa4 100644 --- a/dag/test/claim/markdown_markup_xss_witness_test.dag +++ b/dag/test/claim/markdown_markup_xss_witness_test.dag @@ -1,4 +1,46 @@ module test.claim.markdown_markup_xss_witness +import std.markup { + escape_url, + Serialized, + Rejected, +} +import extdeps.uri_validation { + validate_href, + SafeHref, + RejectedHref, + DangerousScheme, + DataScheme, + JavascriptScheme, +} +import extdeps.languages.html_fragment { serialize_fragment } +import extdeps.languages.markdown { + serialize_markdown_document, + try_serialize_markdown_document, +} +import std.markdown { + CodeBlock, + CodeInline, + EmphasisInline, + HeadingBlock, + H1, + H2, + ImageInline, + LinkInline, + MarkdownBlock, + MarkdownDocument, + MarkdownInline, + MarkdownListItem, + OrderedListBlock, + ParagraphBlock, + StrongInline, + TextInline, + UnorderedListBlock, + markdown_document_to_fragment, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/markdown_roundtrip_test.dag b/dag/test/claim/markdown_roundtrip_test.dag index 4b7ee4cc14a..494f71ff9e2 100644 --- a/dag/test/claim/markdown_roundtrip_test.dag +++ b/dag/test/claim/markdown_roundtrip_test.dag @@ -1,4 +1,38 @@ module test.claim.markdown_roundtrip +import std.markdown { + MarkdownDocument, + MarkdownListItem, + MarkdownTaskItem, + HeadingBlock, + ParagraphBlock, + UnorderedListBlock, + OrderedListBlock, + CodeBlock, + TaskListBlock, + TextInline, + EmphasisInline, + H1, + H2, + Checked, + Unchecked, +} +import extdeps.languages.markdown { + MarkdownSpellings, + commonmark_gfm_spellings, + serialize_markdown_source, + serialize_markdown_source_with, + ingest_markdown_source, + ingest_markdown_source_with, + markdown_medium_lossless, +} +import extdeps.communication.medium { + Lossless, + Lossy, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/markdown_source_emit_test.dag b/dag/test/claim/markdown_source_emit_test.dag index 63ecee84677..61d280f836a 100644 --- a/dag/test/claim/markdown_source_emit_test.dag +++ b/dag/test/claim/markdown_source_emit_test.dag @@ -1,4 +1,39 @@ module test.claim.markdown_source_emit +import std.markdown { + MarkdownDocument, + MarkdownListItem, + MarkdownTaskItem, + MarkdownTableRow, + MarkdownTableCell, + HeadingBlock, + ParagraphBlock, + UnorderedListBlock, + OrderedListBlock, + CodeBlock, + TaskListBlock, + TableBlock, + BlockquoteBlock, + TextInline, + EmphasisInline, + StrongInline, + CodeInline, + LinkInline, + H1, + Checked, + Unchecked, + AlignNone, + AlignCenter, +} +import extdeps.languages.markdown { + MarkdownSpellings, + commonmark_gfm_spellings, + serialize_markdown_source, + serialize_markdown_source_with, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/markup_medium_convergence_test.dag b/dag/test/claim/markup_medium_convergence_test.dag index a7e83efa625..6e2397a633b 100644 --- a/dag/test/claim/markup_medium_convergence_test.dag +++ b/dag/test/claim/markup_medium_convergence_test.dag @@ -1,38 +1,38 @@ module test.claim.markup_medium_convergence - import std.markup { - Fragment, Element, - FragmentText, - attr, - MarkupMedium, - MarkupBracket, - TagDelimiter, EscapeHtml, EscapeRaw, + Fragment, + FragmentText, + MarkupBracket, + MarkupMedium, OmitClose, + TagDelimiter, + attr, serialize_fragment_with, } import extdeps.languages.html { - html_markup_medium, - canonical_html_spellings, - try_serialize_html_source, EmitOk, EmitRejected, + canonical_html_spellings, + html_markup_medium, + try_serialize_html_source, } import extdeps.languages.markdown { - markdown_markup_medium, commonmark_gfm_spellings, + markdown_markup_medium, serialize_markdown_source_with, } import std.markdown { + EmphasisInline, + LinkInline, MarkdownDocument, ParagraphBlock, StrongInline, - EmphasisInline, TextInline, - LinkInline, } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/markup_serializer_witness_test.dag b/dag/test/claim/markup_serializer_witness_test.dag index 7300006bbb4..777e775f198 100644 --- a/dag/test/claim/markup_serializer_witness_test.dag +++ b/dag/test/claim/markup_serializer_witness_test.dag @@ -1,20 +1,20 @@ module test.claim.markup_serializer_witness - import std.markup { - Fragment, - FragmentText, - Element, Attribute, AttributeContext, + Element, + Fragment, + FragmentText, UrlContext, - escape_text, escape_attribute, + escape_text, escape_url, - unescape_text, unescape_attribute, + unescape_text, unescape_url, } import extdeps.languages.html_fragment { serialize_fragment } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/materialization_ladder_witness_test.dag b/dag/test/claim/materialization_ladder_witness_test.dag index cc8b3f7058a..ae085da67e2 100644 --- a/dag/test/claim/materialization_ladder_witness_test.dag +++ b/dag/test/claim/materialization_ladder_witness_test.dag @@ -1,5 +1,77 @@ module test.claim.materialization_ladder_witness - +import std.materialization_ladder { + Frame, + FrameKind, + SharedStateFrame, + IsolatedChildrenFrame, + ReplayedFrame, + UnboundedSiblingsFrame, + FrameDemand, + DemandNature, + PureComputation, + IdempotentEffect, + WorldRead, + FreshEffect, + CacheProvider, + ContentKeyed, + ExistenceKeyed, + ProviderTier, + ReferenceTier, + CopyTier, + MemoTier, + ArtifactTier, + CasTier, + ScopeExit, + SpacePacked, + CoversAllComputations, + LadderVerdict, + DeclaredComputation, + materialization_ladder, + materialization_ladder_holds, + ladder_zero_demand_verdicts, + AccessMode, + ReadAccess, + ConsumeAccess, + CarryAccess, + ProjectAccess, + ValueConsumerEdge, + ValueUsage, + ValueMaterialization, + value_materialization, + value_materialization_is_green, + value_verdict_is_moved, + value_verdict_is_shared_by_reference, + value_verdict_is_demoted_to_copy, + value_verdict_is_refused_affine, + value_verdict_is_refused_needing_reference, + value_verdict_is_refused_needing_copy, + value_verdict_is_dead, + empty_frame_path, + no_cache_providers, + no_cost_floor_exemptions, + verdict_is_authored_duplication, + verdict_is_discharged_by, + verdict_is_refused_no_provider, + verdict_is_refused_scope_too_narrow, + verdict_is_refused_existence_keyed, + verdict_is_refused_unmodeled_world_read, + verdict_is_exempt_fresh, + verdict_is_accepted_below_cost_floor, + verdict_is_accepted_single_recompute, + verdict_is_dead_computation, + verdict_is_accepted_effect_is_the_use, + verdict_is_refused_nature_conflict, +} +import std.types { + Bool, + Int, + List, + String, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/materialized_secret_witness_test.dag b/dag/test/claim/materialized_secret_witness_test.dag index 0ca69a65709..8c29f4c2199 100644 --- a/dag/test/claim/materialized_secret_witness_test.dag +++ b/dag/test/claim/materialized_secret_witness_test.dag @@ -1,4 +1,20 @@ module test.claim.materialized_secret +import std.credentials { EnvVar } +import v2.std.live_tree { LiveTreeDisposition } +import gunbc.auth.materialized_secret { + MaterializedSecret, + github_app_jwt_mint_probe, + liveness_self_repairing_probe_sketch, + materialization_completed, + materialization_gate_accepts, + materialize_existence_only_widen_sketch, + secret_existence_verdict, + secret_liveness_qualified_verdict, + with_materialized_secret, +} +import extdeps.cloud.gcp.secret_ref { SecretRef } +import gunbc.runner_host_deploy { gunbc_ci_github_app } +import gunbc.host_phase_status { observation_verdict_eq } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/measure_lifted_algebra_test.dag b/dag/test/claim/measure_lifted_algebra_test.dag index b7a8ad675c6..97adc01fa63 100644 --- a/dag/test/claim/measure_lifted_algebra_test.dag +++ b/dag/test/claim/measure_lifted_algebra_test.dag @@ -1,4 +1,18 @@ module test.claim.measure_lifted_algebra +import std.measure { + byte_size, + byte_size_count, + hertz, + hertz_count, + measure_scale_fraction_floor, + measure_fit_count_floor, + measure_scale_fraction_ceil, +} +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/measure_magnitude_carrier_test.dag b/dag/test/claim/measure_magnitude_carrier_test.dag index 72f624c6e3f..9312474b415 100644 --- a/dag/test/claim/measure_magnitude_carrier_test.dag +++ b/dag/test/claim/measure_magnitude_carrier_test.dag @@ -1,5 +1,28 @@ module test.claim.measure_magnitude_carrier - +import std.measure { + Measure, + ByteSize, + byte_size, + byte_size_count, + Mebibyte, + mebibyte, + mebibyte_count, + Millicore, + millicore, + millicore_count, + ElectricPotential, + Micro, + celsius, + celsius_count, + money_amount_micro, + money_amount_micro_count, +} +import std.types { Int } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/medium_fidelity_witness_test.dag b/dag/test/claim/medium_fidelity_witness_test.dag index 98afabde260..7c6f1137164 100644 --- a/dag/test/claim/medium_fidelity_witness_test.dag +++ b/dag/test/claim/medium_fidelity_witness_test.dag @@ -1,4 +1,16 @@ module test.claim.medium_fidelity +import extdeps.communication.medium { + DecodeFidelity, + Lossless, + Lossy, + Medium, +} +import std.types { String } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/memory_scale_factor_derivation_test.dag b/dag/test/claim/memory_scale_factor_derivation_test.dag index a2c9452360b..8fae56457a9 100644 --- a/dag/test/claim/memory_scale_factor_derivation_test.dag +++ b/dag/test/claim/memory_scale_factor_derivation_test.dag @@ -1,5 +1,17 @@ module test.claim.memory_scale_factor_derivation - +import std.bit { Bool } +import std.nat { Nat } +import std.measure { + Scale, + Kibi, + Mebi, + Tebi, + memory_scale_factor_bytes, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/merge_admission_actuator_witness_test.dag b/dag/test/claim/merge_admission_actuator_witness_test.dag index 043da6ba251..bd8bd4920f2 100644 --- a/dag/test/claim/merge_admission_actuator_witness_test.dag +++ b/dag/test/claim/merge_admission_actuator_witness_test.dag @@ -1,5 +1,30 @@ module test.claim.merge_admission_actuator_witness - +import gunbc.merge_admission { + MergeAdmissionReceipt, + KeyedReceipt, + MergeAdmissionVerdict, + MergeAdmitted, + MergeDeniedStaleBase, + MergeDeniedStaleRoster, + MergeDeniedNotSuccess, + classify_merge_admission_verdict, + merge_admission_would_block, + merge_admission_enforcement_policy, +} +import extdeps.github.checks { + Success, + Skipped, +} +import gunbc.ci_failure_class { + merge_admission_blocks_merge, + merge_freshness_gating_status, + gating_is_enforced, +} +import std.types { ContentHash } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/merge_admission_deployed_gate_control_test.dag b/dag/test/claim/merge_admission_deployed_gate_control_test.dag index b5daf2a37c3..365c55c9593 100644 --- a/dag/test/claim/merge_admission_deployed_gate_control_test.dag +++ b/dag/test/claim/merge_admission_deployed_gate_control_test.dag @@ -1,5 +1,18 @@ module test.claim.merge_admission_deployed_gate_control - +import gunbc.merge_admission { + MergeAdmissionReceipt, + merge_admission_would_block, +} +import extdeps.github.checks { Success } +import gunbc.ci_failure_class { + merge_admission_blocks_merge, + merge_freshness_verdict_is_consumed_to_block, +} +import std.types { ContentHash } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/merge_admission_enforcement_witness_test.dag b/dag/test/claim/merge_admission_enforcement_witness_test.dag index 3eea9b1d66e..ab83059f230 100644 --- a/dag/test/claim/merge_admission_enforcement_witness_test.dag +++ b/dag/test/claim/merge_admission_enforcement_witness_test.dag @@ -1,5 +1,41 @@ module test.claim.merge_admission_enforcement_witness - +import gunbc.merge_admission { + MergeAdmissionReceipt, + current_gate_roster_hash, + classify_merge_admission_verdict, + merge_admission_would_block, + MergeAdmitted, + MergeDeniedStaleBase, + MergeDeniedStaleRoster, + MergeDeniedNotSuccess, +} +import extdeps.github.checks { + Success, + Failure, +} +import gunbc.merge_admission_produce { + render_receipt_wire, + parse_receipt_wire, + stamp_floor_receipt, +} +import gunbc.ci_failure_class { + merge_admission_blocks_merge, + merge_freshness_gating_status, + gating_is_enforced, + GatingComputedDeferred, + merge_admission_enforcement_gating_scaffold, +} +import gunbc.ci_workflow { merge_admission_gate_step_name } +import std.disposition { + Scaffold, + SingleAuthority, + Terminal, +} +import std.types { ContentHash } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/merge_admission_producer_witness_test.dag b/dag/test/claim/merge_admission_producer_witness_test.dag index 601b5434773..42fb0edd780 100644 --- a/dag/test/claim/merge_admission_producer_witness_test.dag +++ b/dag/test/claim/merge_admission_producer_witness_test.dag @@ -1,5 +1,34 @@ module test.claim.merge_admission_producer_witness - +import gunbc.merge_admission { + MergeAdmissionReceipt, + current_gate_roster_hash, + mint_merge_admission_receipt, +} +import extdeps.github.checks { + Success, + Failure, + check_conclusion_wire_label, + Skipped, +} +import gunbc.merge_admission_produce { + merge_admission_receipt_schema, + merge_admission_receipt_rel_path, + render_receipt_wire, + parse_receipt_wire, + stamp_floor_receipt, + floor_exit_to_check_conclusion, + shell_stdout_line, +} +import v2.workflow.ci_merge_admission_emit { ci_floor_stamp_merge_admission_script } +import tools.merge_admission_stamp { + merge_admission_stamp_missing_floor_exit_is_failure, + merge_admission_stamp_non_pr_omits_pr_number, +} +import std.types { ContentHash } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/merge_admission_witness_test.dag b/dag/test/claim/merge_admission_witness_test.dag index 835ffdfb0bf..a3e15f6584d 100644 --- a/dag/test/claim/merge_admission_witness_test.dag +++ b/dag/test/claim/merge_admission_witness_test.dag @@ -1,5 +1,30 @@ module test.claim.merge_admission_witness - +import gunbc.merge_admission { + MergeAdmissionReceipt, + AdmissionPolicy, + PerPrGateOnly, + RequireUpToDateBase, + KeyedReceipt, + policy_admits, + receipt_is_admissible, + current_gate_roster_hash, + gate_roster_content_hash, + gunbc_repo_standard, + SquashMerge, +} +import extdeps.github.checks { Success } +import gunbc.commit_workflow { + commit_gate_roster, + CommitCheckEnrollment, + CommitSpecGate, + GitPrePushHook, +} +import gunbc.ci_gate { EmitHostGate } +import std.types { ContentHash } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/module_graph/conformance_imports_only.dag b/dag/test/claim/module_graph/conformance_imports_only.dag index ebb5d3b9fd1..5ea08702a34 100644 --- a/dag/test/claim/module_graph/conformance_imports_only.dag +++ b/dag/test/claim/module_graph/conformance_imports_only.dag @@ -1,5 +1,24 @@ module test.claim.module_graph.conformance_imports_only - +import std.algebra { Empty } +import v2.std.algebra { + bag_eq, + fold_list, + list_snoc_item, +} +import v2.std.diagnostic { + Accepted, + Rejected, +} +import v2.std.collection { List } +import v2.std.logic { Bool } +import v2.std.node { + Behavior, + Symbol, +} +import v2.std.node_query { + coproduct_arm_keys, + coproduct_nullary_inhabitants, +} data reflect_connective_type: Symbol = ^Connective data reflect_behavior_type: Symbol = ^Behavior diff --git a/dag/test/claim/namespace_unique_on_chain_policy_hand_rust_witness_test.dag b/dag/test/claim/namespace_unique_on_chain_policy_hand_rust_witness_test.dag new file mode 100644 index 00000000000..1f1ea6e5aef --- /dev/null +++ b/dag/test/claim/namespace_unique_on_chain_policy_hand_rust_witness_test.dag @@ -0,0 +1,136 @@ +module test.claim.namespace_unique_on_chain_policy_hand_rust_witness_test + +import std.disposition { Scaffold, SingleAuthority } +import test.retirement.model { TestModuleRetirement, RetainedNonMigratable } +import test.retirement.namespace_unique_on_chain_policy_retained { + namespace_unique_on_chain_policy_retention, +} +import gunbc.namespace_unique_on_chain_policy_scaffold { + namespace_unique_on_chain_policy_hand_rust_scaffold, + namespace_unique_on_chain_policy_hand_rust_dissolve_trigger, + namespace_unique_on_chain_policy_hand_rust_receipt_plan_anchor, + namespace_unique_on_chain_policy_hand_rust_loc_before, + namespace_unique_on_chain_policy_hand_rust_loc_after, + namespace_unique_on_chain_policy_containment_census_test_discriminator, + namespace_unique_on_chain_policy_zero_on_chain_test_discriminator, + namespace_unique_on_chain_policy_single_off_chain_test_discriminator, + namespace_unique_on_chain_policy_loc_delta_net, + namespace_unique_on_chain_policy_cli_run_hand_rust_loc_delta_net, + namespace_unique_on_chain_policy_cli_run_hand_rust_census_note, + namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_loc_delta_net, + namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_census_note, +} + +test fn namespace_unique_on_chain_policy_cli_run_growth_is_censused() -> Bool { + namespace_unique_on_chain_policy_cli_run_hand_rust_loc_delta_net > 0 && + string_contains( + s: namespace_unique_on_chain_policy_cli_run_hand_rust_census_note, + pattern: "cli_run.rs", + ) && + string_contains( + s: namespace_unique_on_chain_policy_cli_run_hand_rust_census_note, + pattern: "DISSOLVE-ON", + ) && + string_contains( + s: namespace_unique_on_chain_policy_cli_run_hand_rust_census_note, + pattern: "namespace-canonical-binding", + ) +} + +test fn namespace_unique_on_chain_policy_parsed_dag_file_growth_is_censused() -> Bool { + namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_loc_delta_net > 0 && + string_contains( + s: namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_census_note, + pattern: "parsed_dag_file.rs", + ) && + string_contains( + s: namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_census_note, + pattern: "DISSOLVE-ON", + ) && + string_contains( + s: namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_census_note, + pattern: "namespace-canonical-binding", + ) +} + +test fn namespace_unique_on_chain_policy_hand_rust_total_is_the_sum_of_its_rows() -> Bool { + ((namespace_unique_on_chain_policy_loc_delta_net + + namespace_unique_on_chain_policy_cli_run_hand_rust_loc_delta_net) + + namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_loc_delta_net) == 201 && + string_contains( + s: namespace_unique_on_chain_policy_parsed_dag_file_hand_rust_census_note, + pattern: "= +201", + ) +} + + +test fn namespace_unique_on_chain_policy_retention_defers_to_one_census_authority() -> Bool { + match namespace_unique_on_chain_policy_retention.disposition { + RetainedNonMigratable { reason: reason } => + !string_contains(s: reason, pattern: "net=+") && + !string_contains(s: reason, pattern: "after=") && + string_contains(s: reason, pattern: "ONE LOC census authority") + _ => false + } +} + +test fn namespace_unique_on_chain_policy_cli_run_carries_no_stale_absolutes() -> Bool { + !string_contains( + s: namespace_unique_on_chain_policy_cli_run_hand_rust_census_note, + pattern: "goes 32513", + ) && + string_contains( + s: namespace_unique_on_chain_policy_cli_run_hand_rust_census_note, + pattern: "ONLY as a delta", + ) +} + +test fn namespace_unique_on_chain_policy_hand_rust_scaffold_is_seed_retained() -> Bool { + match namespace_unique_on_chain_policy_hand_rust_scaffold { + Scaffold { dissolves_to: SingleAuthority, bind: _ } => true + _ => false + } +} + +test fn namespace_unique_on_chain_policy_hand_rust_dissolve_trigger_names_lane() -> Bool { + string_contains( + s: namespace_unique_on_chain_policy_hand_rust_dissolve_trigger, + pattern: "namespace-canonical-binding", + ) && + string_contains( + s: namespace_unique_on_chain_policy_hand_rust_dissolve_trigger, + pattern: "NameResolutionPolicy", + ) +} + +test fn namespace_unique_on_chain_policy_hand_rust_receipt_plan_anchor_is_checkable() -> Bool { + string_contains( + s: namespace_unique_on_chain_policy_hand_rust_receipt_plan_anchor, + pattern: "gunbc.roadmap_authority", + ) && + string_contains( + s: namespace_unique_on_chain_policy_hand_rust_receipt_plan_anchor, + pattern: "namespace-canonical-binding", + ) && + namespace_unique_on_chain_policy_hand_rust_loc_before > 0 && + namespace_unique_on_chain_policy_hand_rust_loc_after > + namespace_unique_on_chain_policy_hand_rust_loc_before && + namespace_unique_on_chain_policy_loc_delta_net == + (namespace_unique_on_chain_policy_hand_rust_loc_after - + namespace_unique_on_chain_policy_hand_rust_loc_before) +} + +test fn namespace_unique_on_chain_policy_discriminating_tests_named() -> Bool { + string_contains( + s: namespace_unique_on_chain_policy_containment_census_test_discriminator, + pattern: "containment_census", + ) && + string_contains( + s: namespace_unique_on_chain_policy_zero_on_chain_test_discriminator, + pattern: "zero_on_chain", + ) && + string_contains( + s: namespace_unique_on_chain_policy_single_off_chain_test_discriminator, + pattern: "single_off_chain", + ) +} diff --git a/dag/test/claim/nbd_proxy_endpoint_witness_test.dag b/dag/test/claim/nbd_proxy_endpoint_witness_test.dag index ea040d2a257..2a6fc1b6df8 100644 --- a/dag/test/claim/nbd_proxy_endpoint_witness_test.dag +++ b/dag/test/claim/nbd_proxy_endpoint_witness_test.dag @@ -1,5 +1,15 @@ module test.claim.nbd_proxy_endpoint - +import std.bit { Bool } +import std.types { list_length } +import extdeps.bmc.webui.nbd_proxy { VmSlotIndexEndpoint } +import extdeps.boards.asrock_rack { + asrock_altrad8ud_openbmc_2_07_00_nbd_proxy_primary_endpoint, + asrock_altrad8ud_openbmc_2_07_00_nbd_proxy_absent_endpoints, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/nbd_proxy_serve_transport_witness_test.dag b/dag/test/claim/nbd_proxy_serve_transport_witness_test.dag index 0427cf0c09d..88ceb8433dd 100644 --- a/dag/test/claim/nbd_proxy_serve_transport_witness_test.dag +++ b/dag/test/claim/nbd_proxy_serve_transport_witness_test.dag @@ -1,5 +1,40 @@ module test.claim.nbd_proxy_serve_transport - +import std.bit { Bool } +import std.types { NonEmptyStr } +import std.disposition { + Scaffold, + Terminal, +} +import extdeps.bmc.webui.nbd_proxy { + VmSlotIndexEndpoint, + bmcweb_nbd_proxy_ws_path, +} +import extdeps.bmc.webui.nbd_proxy_serve { + bmcweb_session_login_argv, + bmcweb_session_login_curl_args, + bmcweb_session_token_env_ref, + nbd_proxy_serve_argv_surface_contains_supervision_marker, + nbd_proxy_serve_cited_tool_names, + nbd_proxy_serve_has_no_shell_supervision_grammar, + nbd_proxy_serve_nbdkit_argv_includes_iso, + nbd_proxy_serve_nbdkit_unit_name, + nbd_proxy_serve_requires_host_as_nbd_server, + nbd_proxy_serve_systemd_realization_dissolution_trigger, + nbd_proxy_serve_transport_intent, + nbd_proxy_serve_websocat_argv_leading_tool_is_websocat, + nbd_proxy_serve_websocat_unit_name, + srv3_nbd_proxy_local_port, +} +import extdeps.boards.asrock_rack { asrock_srv3_live_bmc_host } +import extdeps.tools.curl { curl_cli_tool } +import extdeps.tools.websocat { websocat_cli_tool } +import extdeps.tools.nbdkit { nbdkit_cli_tool } +import extdeps.tools.socat { socat_cli_tool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import gunbc.srv3_nbd_proxy_serve_intent { srv3_nbd_proxy_lease_key } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/nbd_proxy_virtual_media_install_witness_test.dag b/dag/test/claim/nbd_proxy_virtual_media_install_witness_test.dag index b018ada8ff7..a882c4a57ce 100644 --- a/dag/test/claim/nbd_proxy_virtual_media_install_witness_test.dag +++ b/dag/test/claim/nbd_proxy_virtual_media_install_witness_test.dag @@ -1,5 +1,41 @@ module test.claim.nbd_proxy_virtual_media_install - +import std.bit { Bool } +import std.types { list_length } +import std.disposition { + Scaffold, + Terminal, +} +import extdeps.bmc.types { + BootTargetCd, + BootTargetPxe, +} +import extdeps.bmc.webui.nbd_proxy { VmSlotIndexEndpoint } +import gunbc.os_install_mechanism { + NbdProxyVirtualMediaInstall, + PxeHttpInstall, + install_boot_target_for, + srv3_install_mechanism, + srv3_install_boot_target, +} +import gunbc.nbd_proxy_virtual_media_install { + OsInstallActuatorStep, + ActuatorNbdProxyServe, + ActuatorBootOnce, + ActuatorForceRestart, + ActuatorPxeNetworkBootStaging, + srv3_os_install_actuator_plan, + os_install_actuator_step_count, + os_install_actuator_steps, + srv3_nbd_proxy_export_placeholder, + srv3_nbd_proxy_export_dissolution_trigger, + actuator_step_to_host_effect_intent, +} +import gunbc.os_install_actuator_selection { srv3_os_install_actuator_host } +import extdeps.bmc.webui.nbd_proxy_serve { nbd_proxy_serve_systemd_realization_dissolution_trigger } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/network_grounding_witness_test.dag b/dag/test/claim/network_grounding_witness_test.dag index 092b52667c4..e7dd49b63c1 100644 --- a/dag/test/claim/network_grounding_witness_test.dag +++ b/dag/test/claim/network_grounding_witness_test.dag @@ -1,5 +1,39 @@ module test.claim.network_grounding - +import extdeps.dns.domain_name { + DnsLabel, + DomainName, +} +import extdeps.dhcp.v4 { HostName } +import extdeps.network.ipv4 { + Ipv4Address, + ipv4_address, + parse_ipv4_address, + render_ipv4_address, +} +import v2.std.live_tree { LiveTreeDisposition } +import extdeps.network.endpoint { + NetworkHost, + host_by_ipv4, + host_by_name, + render_network_host, + socket_address, +} +import extdeps.network.reach { + direct_lan, + fabric_tunnel, + proxy_jump, + reach_is_realizable, + reach_realizability, + reach_target, +} +import extdeps.network.address { + ip_address_is_loopback, + ip_address_is_v4, + ip_v4, + ip_v6, + render_ip_address, +} +import extdeps.network.ipv6 { ipv6_address } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/node_http_server_emit_test.dag b/dag/test/claim/node_http_server_emit_test.dag index bbad0ee6c0a..64b0d160536 100644 --- a/dag/test/claim/node_http_server_emit_test.dag +++ b/dag/test/claim/node_http_server_emit_test.dag @@ -1,5 +1,10 @@ module test.claim.node_http_server_emit - +import std.bit { Bool } +import gunbc.node_http_server_emit { gunbhub_node_http_server_source } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/non_fold_residue_witness_test.dag b/dag/test/claim/non_fold_residue_witness_test.dag index fde8b781d87..1cd19634c2b 100644 --- a/dag/test/claim/non_fold_residue_witness_test.dag +++ b/dag/test/claim/non_fold_residue_witness_test.dag @@ -1,4 +1,8 @@ module test.claim.non_fold_residue_witness +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/observability_channel_routing_witness_test.dag b/dag/test/claim/observability_channel_routing_witness_test.dag index fd6cfb7afcf..55940e36abf 100644 --- a/dag/test/claim/observability_channel_routing_witness_test.dag +++ b/dag/test/claim/observability_channel_routing_witness_test.dag @@ -1,5 +1,18 @@ module test.claim.observability_channel_routing - +import std.bit { Bool } +import std.bmc { OpenBmc } +import extdeps.bmc.openbmc { bmc_firmware_host_storage_visibility } +import extdeps.observability { + OutOfBand, + StorageInventory, + NetworkInventory, + PowerDraw, + route_observation, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/observation_ci_render_witness_test.dag b/dag/test/claim/observation_ci_render_witness_test.dag index 7f3d0f4a28f..60d81081b3d 100644 --- a/dag/test/claim/observation_ci_render_witness_test.dag +++ b/dag/test/claim/observation_ci_render_witness_test.dag @@ -1,58 +1,82 @@ module test.claim.observation_ci_render_witness_test - -import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } -import std.types { NonEmptyStr, String, Bool, List } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import std.types { + Bool, + List, + NonEmptyStr, + String, +} import std.nat { Nat } -import std.symbols { Tier, Emoji, Unicode, Ascii, StatusPulse, StatusDwell, StatusBlocked, StatusRefused, NodeFailed, NodeCompleted } -import std.measure { nanosecond, millisecond, millisecond_to_nanosecond, byte_size, basis_point } +import std.symbols { + Ascii, + Emoji, + NodeCompleted, + NodeFailed, + StatusBlocked, + StatusDwell, + StatusPulse, + StatusRefused, + Tier, + Unicode, +} +import std.measure { + basis_point, + byte_size, + millisecond, + millisecond_to_nanosecond, + nanosecond, +} import std.observation { - ObservationSubject, - RunSegment, + Ambient, + Anomaly, + AttentionBasis, BatchSegment, - EntrySegment, - ModuleSegment, - PhaseSegment, - MeasuredValue, - MeasuredUnavailable, - ObservationEvent, Begin, - Step, Concluded, Done, - Refused, + EntrySegment, Failed, - AttentionBasis, - Ambient, + MeasuredUnavailable, + MeasuredValue, + ModuleSegment, Notable, - Anomaly, + ObservationEvent, + ObservationSubject, + PhaseSegment, + PsiPressure, + Refused, + RunSegment, + Step, observation_dwell_threshold, observation_escalation_depth, - PsiPressure, } import gunbc.observation_ci_render { - RenderedLine, - LinePlacement, + FloorRunSummary, + HeartbeatSample, InsideCollapsedGroup, + LinePlacement, OutsideGroup, - ci_line_placement, - ci_render_line, + RenderedLine, + ci_collapsed_summary, + ci_escalation_blocked_line, + ci_escalation_emission_count, + ci_escalation_line, ci_event_line, + ci_group_close, + ci_group_open, ci_heartbeat_line, - ci_escalation_line, - ci_escalation_blocked_line, ci_human_bytes, ci_human_duration, ci_human_percent, - ci_collapsed_summary, - ci_run_summary_line, + ci_line_placement, ci_refusal_restate_line, - HeartbeatSample, - FloorRunSummary, - ci_group_open, - ci_group_close, - ci_escalation_emission_count, - ci_window_is_responsive, + ci_render_line, ci_run_summary_glyph, + ci_run_summary_line, + ci_window_is_responsive, } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/observation_model_witness_test.dag b/dag/test/claim/observation_model_witness_test.dag index f037314a0f8..e16a62ee9ab 100644 --- a/dag/test/claim/observation_model_witness_test.dag +++ b/dag/test/claim/observation_model_witness_test.dag @@ -1,159 +1,183 @@ module test.claim.observation_model_witness_test - -import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } -import std.types { NonEmptyStr, String, Bool, List } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import std.types { + Bool, + List, + NonEmptyStr, + String, +} import std.symbols { - Tier, - Emoji, - Unicode, Ascii, - SymbolId, - SemanticColor, - Success, - Warning, - Error, - StatusWarning, - StatusPulse, ChangeAdded, ChangeModified, ChangeRemoved, + Emoji, + Error, + SemanticColor, + StatusPulse, + StatusWarning, + Success, + SymbolId, + Tier, + Unicode, + Warning, +} +import std.change { + KeyedDiffAddedHunk, + KeyedDiffModifiedHunk, + KeyedDiffRemovedHunk, +} +import std.decl_ref { + DeclarationRef, + NamedField, + WholeDeclaration, } -import std.change { KeyedDiffAddedHunk, KeyedDiffRemovedHunk, KeyedDiffModifiedHunk } -import std.decl_ref { DeclarationRef, WholeDeclaration, NamedField } import std.measure { - Nanosecond, - nanosecond, - Millisecond, - millisecond, - millisecond_to_nanosecond, - ByteSize, - byte_size, BasisPoint, + ByteSize, + Millisecond, + Nanosecond, basis_point, basis_point_count, + byte_size, + millisecond, + millisecond_to_nanosecond, + nanosecond, +} +import std.perturbation { + BackwardDiffInDiffOut, + ForwardSameInSameOut, + perturbation_consistent, +} +import extdeps.render.glyphs { + resolve_symbol, + reward_animal_at, + reward_animals, + symbol_color, } -import std.perturbation { BackwardDiffInDiffOut, ForwardSameInSameOut, perturbation_consistent } -import extdeps.render.glyphs { resolve_symbol, symbol_color, reward_animal_at, reward_animals } import std.observation { - ObservationSegment, - RunSegment, - BatchSegment, - EntrySegment, - ModuleSegment, - DeclarationSegment, - PhaseSegment, - ObservationSubject, - ObservationGrain, - RunGrain, - BatchGrain, - EntryGrain, - ModuleGrain, - DeclarationGrain, - PhaseGrain, - observation_grain_of_segment, - observation_grain_depth, - observation_subject_grain, - observation_subject_entry_path, - observation_subject_declaration, - observation_subject_phase_name, - observation_subject_module_path, - observation_grain_at_or_above_entry, - observation_subject_contains, - observation_subject_path, - observation_subject_render, - observation_segment_key, - observation_declaration_key, - Measured, - MeasuredValue, - MeasuredUnavailable, - ObservationOutcome, - Done, - Refused, - Failed, - TimedOut, - Skipped, - Final, - ObservationTransition, - Begin, - Step, - Concluded, - ObservationEvent, - SchedulerHold, - WindowFull, - CurrentHighWater, - PsiPressure, - SwapGrowth, - AwaitFirstCost, - InsufficientHeadroom, AdmissionCeiling, - ContendedResource, - MemoryBudget, AdmissionWindow, - MaturationReserve, - ContentionRemaining, - RemainingUnknown, - RemainingBounded, - BlockedOn, - observation_hold_resource, - observation_blocked_on, - AttentionLevel, Ambient, - Notable, Anomaly, - AttentionBasis, - ObservationAttention, + AnomalyExpanded, AttentionAssigned, + AttentionBasis, + AttentionLevel, AttentionRefused, - observation_attention_under, - observation_attention, - observation_outcome_is_anomaly, - ObservationEventClass, + AwaitFirstCost, + BatchGrain, + BatchSegment, + Begin, + BlockedOn, + ChangePresentation, ClassBegin, - ClassStep, + ClassBlocked, ClassDone, - ClassRefused, + ClassDwellEscalation, ClassFailed, - ClassTimedOut, - ClassSkipped, ClassFinal, - ClassBlocked, - ClassDwellEscalation, - observation_event_classes, - observation_event_class, - observation_class_is_intrinsic_anomaly, + ClassRefused, + ClassSkipped, + ClassStep, + ClassTimedOut, + Concluded, + ContendedResource, + ContentionRemaining, + CurrentHighWater, + DeclarationGrain, + DeclarationSegment, + DepartedPath, + DocsPolicy, + Done, + DwellThreshold, + EntryGrain, + EntrySegment, + Failed, + Final, + InsufficientHeadroom, + MaturationReserve, + Measured, + MeasuredUnavailable, + MeasuredValue, + MemoryBudget, + ModuleGrain, + ModuleSegment, + NoDeclsTouched, + Notable, + ObservationAttention, ObservationDensity, + ObservationEvent, + ObservationEventClass, + ObservationGrain, + ObservationLaw, + ObservationOutcome, + ObservationPresentation, + ObservationSegment, + ObservationSubject, + ObservationTransition, + PhaseGrain, + PhaseSegment, + PsiPressure, + Refused, + RemainingBounded, + RemainingUnknown, RoutineCollapsible, + RunGrain, + RunSegment, + SchedulerHold, + SelectionNoOp, + Skipped, + Step, SummaryAlwaysShown, - AnomalyExpanded, + SwapGrowth, + TimedOut, + Uncovered, + WatchdogOrphanedBegin, + WatchdogQuiet, + WatchdogVerdict, + WindowFull, + observation_attention, + observation_attention_under, + observation_blocked_on, + observation_change_presentation, observation_class_density, + observation_class_glyph, + observation_class_is_intrinsic_anomaly, + observation_declaration_key, observation_density_collapsible, observation_density_expands_fully, - observation_class_glyph, - ObservationPresentation, - observation_presentation, - DwellThreshold, observation_dwell_threshold, observation_escalation_depth, observation_escalation_subject, - WatchdogVerdict, - WatchdogQuiet, - WatchdogOrphanedBegin, - observation_watchdog, - observation_watchdog_attention, - ObservationLaw, + observation_event_class, + observation_event_classes, + observation_grain_at_or_above_entry, + observation_grain_depth, + observation_grain_of_segment, + observation_hold_resource, observation_laws, - ChangePresentation, - observation_change_presentation, - SelectionNoOp, - DocsPolicy, - Uncovered, - NoDeclsTouched, - DepartedPath, - selection_noop_generated_artifact, - observation_no_op_is_actually_a_widen, observation_no_op_attention, - observation_no_op_symbol, observation_no_op_explanation, + observation_no_op_is_actually_a_widen, + observation_no_op_symbol, + observation_outcome_is_anomaly, + observation_presentation, + observation_segment_key, + observation_subject_contains, + observation_subject_declaration, + observation_subject_entry_path, + observation_subject_grain, + observation_subject_module_path, + observation_subject_path, + observation_subject_phase_name, + observation_subject_render, + observation_watchdog, + observation_watchdog_attention, + selection_noop_generated_artifact, } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/observation_tty_render_witness_test.dag b/dag/test/claim/observation_tty_render_witness_test.dag index abf95107fd8..14efcf90e3c 100644 --- a/dag/test/claim/observation_tty_render_witness_test.dag +++ b/dag/test/claim/observation_tty_render_witness_test.dag @@ -1,15 +1,39 @@ module test.claim.observation_tty_render_witness_test - -import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } -import std.types { NonEmptyStr, String, Bool, List } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import std.types { + Bool, + List, + NonEmptyStr, + String, +} import std.nat { Nat } -import std.symbols { Tier, Emoji, Ascii, Spinner0, StatusBlocked, StatusFinal } -import std.measure { nanosecond, millisecond, byte_size, basis_point } -import std.render { CursorAction, Overwrite, Append, RenderCapability } +import std.symbols { + Ascii, + Emoji, + Spinner0, + StatusBlocked, + StatusFinal, + Tier, +} +import std.measure { + basis_point, + byte_size, + millisecond, + nanosecond, +} +import std.render { + Append, + CursorAction, + Overwrite, + RenderCapability, +} import extdeps.render.ansi { ansi_carriage_return, - ansi_line_feed, ansi_erase_entire_line, + ansi_line_feed, } import extdeps.render.terminal { DynamicLineClosed, @@ -19,47 +43,47 @@ import extdeps.render.terminal { project_terminal_write, } import std.observation { - ObservationSubject, - RunSegment, + Ambient, + Anomaly, + AnomalyExpanded, + AttentionBasis, BatchSegment, - EntrySegment, - ModuleSegment, - PhaseSegment, - MeasuredValue, - MeasuredUnavailable, - ObservationEvent, Begin, + BlockedOn, Concluded, Done, - Refused, + EntrySegment, Failed, Final, - AttentionBasis, - RoutineCollapsible, - SummaryAlwaysShown, - AnomalyExpanded, - Ambient, - Notable, - Anomaly, - BlockedOn, + MeasuredUnavailable, + MeasuredValue, MemoryBudget, + ModuleSegment, + Notable, + ObservationEvent, + ObservationSubject, + PhaseSegment, + Refused, RemainingBounded, RemainingUnknown, + RoutineCollapsible, + RunSegment, + SummaryAlwaysShown, } import gunbc.observation_tty_render { PreambleFields, - tty_preamble_line, - tty_cursor_action, - tty_group_line, + TtyEmission, + TtyEmissionProjected, + TtyEmissionProjection, + TtyEmissionRefused, tty_blocked_line, - tty_final_line, + tty_cursor_action, tty_event_emission, tty_event_emission_under, + tty_final_line, + tty_group_line, + tty_preamble_line, tty_render_emission, - TtyEmission, - TtyEmissionProjection, - TtyEmissionProjected, - TtyEmissionRefused, } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/occurrence_binding_resolve_witness_test.dag b/dag/test/claim/occurrence_binding_resolve_witness_test.dag new file mode 100644 index 00000000000..6d53df7d3f8 --- /dev/null +++ b/dag/test/claim/occurrence_binding_resolve_witness_test.dag @@ -0,0 +1,462 @@ +module test.claim.occurrence_binding_resolve_witness_test + +import std.types { Bool, SourceSpan } +import std.algebra { Empty, Cons } +import std.occurrence_identity { + OccurrenceId, + OccurrenceContainmentPath, + OccurrenceProjection, + OccurrenceIndexEntry, + OccurrenceIndex, + OccurrenceTransport, + DeclarationOccurrence, + ReferenceOccurrence, + LexicalValueOccurrence, + TypeOccurrence, + DuplicateAuthoredOccurrenceIdentity, + MissingAuthoredOccurrenceIdentity, + UnknownOccurrenceIdentity, +} +import std.occurrence_binding { + occurrence_binding_from_candidates, + OccurrenceBound, + OccurrenceUnbound, + OccurrenceAmbiguous, + AmbiguousBindingCandidates, +} +import std.occurrence_binding_resolve { + binding_occurrence_from_reference, + binding_candidate_from_declaration, + resolve_reference_occurrence_binding, + module_path_binding_decide, + OccurrenceReferenceBindingDecided, + OccurrenceReferenceBindingTransportRefused, +} + +fn obr_fixture_span(file: String, start: Int, end: Int) -> SourceSpan { + SourceSpan { file: file, start: start, end: end } +} + +fn obr_fixture_path( + ancestors: List, + terminal: OccurrenceId +) -> OccurrenceContainmentPath { + OccurrenceContainmentPath { + ancestors: ancestors, + terminal: terminal, + } +} + +fn obr_fixture_index_entry( + occurrence: OccurrenceId, + authored_name: String, + span: SourceSpan, + containment: OccurrenceContainmentPath +) -> OccurrenceIndexEntry { + OccurrenceIndexEntry { + projection: OccurrenceProjection { + occurrence: occurrence, + authored_name: authored_name, + diagnostic_span: span, + }, + containment: containment, + } +} + +fn obr_unique_transport() -> OccurrenceTransport { + let span = obr_fixture_span(file: "unique.dag", start: 1, end: 2) + let decl_id = OccurrenceId { value: 10 } + let ref_id = OccurrenceId { value: 20 } + let decl_path = obr_fixture_path(ancestors: Empty, terminal: decl_id) + let ref_path = obr_fixture_path( + ancestors: Cons { head: decl_id, tail: Empty }, + terminal: ref_id, + ) + OccurrenceTransport { + index: OccurrenceIndex { + entries: [ + obr_fixture_index_entry( + occurrence: decl_id, + authored_name: "y", + span: span, + containment: decl_path, + ), + obr_fixture_index_entry( + occurrence: ref_id, + authored_name: "y", + span: span, + containment: ref_path, + ), + ], + }, + declarations: [ + DeclarationOccurrence { + occurrence: decl_id, + containment: decl_path, + category: LexicalValueOccurrence, + diagnostic_span: span, + }, + ], + references: [ + ReferenceOccurrence { + occurrence: ref_id, + containment: ref_path, + category: LexicalValueOccurrence, + diagnostic_span: span, + }, + ], + } +} + +fn obr_ambiguous_transport() -> OccurrenceTransport { + let span = obr_fixture_span(file: "ambiguous.dag", start: 3, end: 4) + let pattern_id = OccurrenceId { value: 30 } + let let_id = OccurrenceId { value: 31 } + let ref_id = OccurrenceId { value: 32 } + let pattern_path = obr_fixture_path( + ancestors: Cons { head: OccurrenceId { value: 1 }, tail: Empty }, + terminal: pattern_id, + ) + let let_path = obr_fixture_path( + ancestors: Cons { + head: OccurrenceId { value: 1 }, + tail: Cons { head: pattern_id, tail: Empty }, + }, + terminal: let_id, + ) + let ref_path = obr_fixture_path( + ancestors: Cons { + head: OccurrenceId { value: 1 }, + tail: Cons { head: pattern_id, tail: Cons { head: let_id, tail: Empty } }, + }, + terminal: ref_id, + ) + OccurrenceTransport { + index: OccurrenceIndex { + entries: [ + obr_fixture_index_entry( + occurrence: pattern_id, + authored_name: "y", + span: span, + containment: pattern_path, + ), + obr_fixture_index_entry( + occurrence: let_id, + authored_name: "y", + span: span, + containment: let_path, + ), + obr_fixture_index_entry( + occurrence: ref_id, + authored_name: "y", + span: span, + containment: ref_path, + ), + ], + }, + declarations: [ + DeclarationOccurrence { + occurrence: pattern_id, + containment: pattern_path, + category: LexicalValueOccurrence, + diagnostic_span: span, + }, + DeclarationOccurrence { + occurrence: let_id, + containment: let_path, + category: LexicalValueOccurrence, + diagnostic_span: span, + }, + ], + references: [ + ReferenceOccurrence { + occurrence: ref_id, + containment: ref_path, + category: LexicalValueOccurrence, + diagnostic_span: span, + }, + ], + } +} + +fn obr_unbound_transport() -> OccurrenceTransport { + let span = obr_fixture_span(file: "unbound.dag", start: 5, end: 6) + let ref_id = OccurrenceId { value: 40 } + let ref_path = obr_fixture_path(ancestors: Empty, terminal: ref_id) + OccurrenceTransport { + index: OccurrenceIndex { + entries: [ + obr_fixture_index_entry( + occurrence: ref_id, + authored_name: "missing", + span: span, + containment: ref_path, + ), + ], + }, + declarations: [], + references: [ + ReferenceOccurrence { + occurrence: ref_id, + containment: ref_path, + category: TypeOccurrence, + diagnostic_span: span, + }, + ], + } +} + +test fn occurrence_binding_resolve_unique_reference_is_bound_holds() -> Bool { + let transport = obr_unique_transport() + let reference = transport.references |> first + match reference { + Present { value: ref } => + match resolve_reference_occurrence_binding( + transport: transport, + occurrence: ref.occurrence, + ) { + OccurrenceReferenceBindingDecided { + result: OccurrenceBound { binding: _ }, + } => true + _ => false + } + Absent => false + } +} + +test fn occurrence_binding_resolve_unbound_reference_refuses_holds() -> Bool { + let transport = obr_unbound_transport() + let reference = transport.references |> first + match reference { + Present { value: ref } => + match resolve_reference_occurrence_binding( + transport: transport, + occurrence: ref.occurrence, + ) { + OccurrenceReferenceBindingDecided { + result: OccurrenceUnbound { occurrence: _ }, + } => true + _ => false + } + Absent => false + } +} + +test fn occurrence_binding_resolve_ambiguous_reference_refuses_holds() -> Bool { + let transport = obr_ambiguous_transport() + let reference = transport.references |> first + match reference { + Present { value: ref } => + match resolve_reference_occurrence_binding( + transport: transport, + occurrence: ref.occurrence, + ) { + OccurrenceReferenceBindingDecided { + result: OccurrenceAmbiguous { + occurrence: _, + candidates: AmbiguousBindingCandidates { + first: _, + second: _, + rest: Empty, + }, + }, + } => true + _ => false + } + Absent => false + } +} + +test fn occurrence_binding_resolve_duplicate_candidates_remain_ambiguous_holds() -> Bool { + let transport = obr_unique_transport() + let reference = transport.references |> first + match reference { + Present { value: ref } => + let declaration = transport.declarations |> first + match declaration { + Present { value: decl } => + let duplicate = binding_candidate_from_declaration(declaration: decl) + match occurrence_binding_from_candidates( + occurrence: binding_occurrence_from_reference(reference: ref), + candidates: Cons { + head: duplicate, + tail: Cons { head: duplicate, tail: Empty }, + }, + ) { + OccurrenceAmbiguous { + occurrence: _, + candidates: AmbiguousBindingCandidates { + first: _, + second: _, + rest: Empty, + }, + } => true + _ => false + } + Absent => false + } + Absent => false + } +} + +test fn occurrence_binding_resolve_module_path_unique_owner_is_bound_holds() -> Bool { + match module_path_binding_decide( + env_module_path: "fixchain.mid.leaf", + owners: ["fixchain.mid"], + ) { + OccurrenceBound { binding: _ } => true + _ => false + } +} + +test fn occurrence_binding_resolve_module_path_zero_owners_is_unbound_holds() -> Bool { + match module_path_binding_decide( + env_module_path: "fixchain.mid.leaf", + owners: [], + ) { + OccurrenceUnbound { occurrence: _ } => true + _ => false + } +} + +test fn occurrence_binding_resolve_module_path_two_owners_is_ambiguous_holds() -> Bool { + match module_path_binding_decide( + env_module_path: "fixchain.mid.leaf", + owners: ["fixchain", "fixchain.mid"], + ) { + OccurrenceAmbiguous { + occurrence: _, + candidates: AmbiguousBindingCandidates { + first: observed_first, + second: observed_second, + rest: Empty, + }, + } => + observed_first.containment.terminal == "fixchain" + && observed_second.containment.terminal == "fixchain.mid" + _ => false + } +} + +test fn occurrence_binding_resolve_decide_is_the_single_fold_authority_holds() -> Bool { + let transport = obr_unique_transport() + let reference = transport.references |> first + match reference { + Present { value: ref } => + let direct = resolve_reference_occurrence_binding( + transport: transport, + occurrence: ref.occurrence, + ) + let manual = occurrence_binding_from_candidates( + occurrence: binding_occurrence_from_reference(reference: ref), + candidates: transport.declarations + |> map(binding_candidate_from_declaration), + ) + match direct { + OccurrenceReferenceBindingDecided { result: decided } => decided == manual + OccurrenceReferenceBindingTransportRefused { refusal: _ } => false + } + Absent => false + } +} + +fn obr_duplicate_index_transport() -> OccurrenceTransport { + let span = obr_fixture_span(file: "duplicate.dag", start: 7, end: 8) + let decl_id = OccurrenceId { value: 50 } + let ref_id = OccurrenceId { value: 51 } + let decl_path = obr_fixture_path(ancestors: Empty, terminal: decl_id) + let ref_path = obr_fixture_path( + ancestors: Cons { head: decl_id, tail: Empty }, + terminal: ref_id, + ) + let entry = obr_fixture_index_entry( + occurrence: decl_id, + authored_name: "y", + span: span, + containment: decl_path, + ) + OccurrenceTransport { + index: OccurrenceIndex { + entries: [ + entry, + entry, + obr_fixture_index_entry( + occurrence: ref_id, + authored_name: "y", + span: span, + containment: ref_path, + ), + ], + }, + declarations: [ + DeclarationOccurrence { + occurrence: decl_id, + containment: decl_path, + category: LexicalValueOccurrence, + diagnostic_span: span, + }, + ], + references: [ + ReferenceOccurrence { + occurrence: ref_id, + containment: ref_path, + category: LexicalValueOccurrence, + diagnostic_span: span, + }, + ], + } +} + +test fn occurrence_binding_resolve_malformed_transport_refuses_holds() -> Bool { + let transport = obr_duplicate_index_transport() + let reference = transport.references |> first + match reference { + Present { value: ref } => + match resolve_reference_occurrence_binding( + transport: transport, + occurrence: ref.occurrence, + ) { + OccurrenceReferenceBindingTransportRefused { + refusal: DuplicateAuthoredOccurrenceIdentity { + occurrence: _, + diagnostic_span: _, + }, + } => true + OccurrenceReferenceBindingDecided { result: _ } => false + } + Absent => false + } +} + +test fn occurrence_binding_resolve_unknown_occurrence_refuses_holds() -> Bool { + let transport = obr_unique_transport() + match resolve_reference_occurrence_binding( + transport: transport, + occurrence: OccurrenceId { value: 999 }, + ) { + OccurrenceReferenceBindingTransportRefused { + refusal: UnknownOccurrenceIdentity { + occurrence: observed, + }, + } => observed.value == 999 + OccurrenceReferenceBindingDecided { result: _ } => false + } +} + +test fn occurrence_binding_resolve_declaration_id_is_not_a_reference_holds() -> Bool { + let transport = obr_unique_transport() + let declaration = transport.declarations |> first + match declaration { + Present { value: decl } => + match resolve_reference_occurrence_binding( + transport: transport, + occurrence: decl.occurrence, + ) { + OccurrenceReferenceBindingTransportRefused { + refusal: MissingAuthoredOccurrenceIdentity { diagnostic_span: _ }, + } => true + OccurrenceReferenceBindingDecided { result: _ } => false + } + Absent => false + } +} diff --git a/dag/test/claim/occurrence_identity_witness_test.dag b/dag/test/claim/occurrence_identity_witness_test.dag index ab908809d18..61624cbdd19 100644 --- a/dag/test/claim/occurrence_identity_witness_test.dag +++ b/dag/test/claim/occurrence_identity_witness_test.dag @@ -1,10 +1,12 @@ module test.claim.occurrence_identity_witness_test import std.types { Bool } +import std.algebra { Empty, Cons } import std.occurrence_identity { OccurrenceId, OccurrenceIdAllocator, OccurrenceIdAllocResult, + OccurrenceContainmentPath, NodeOccurrenceIdentity, OccurrenceSynthetic, OccurrenceMinted, @@ -15,6 +17,7 @@ import std.occurrence_identity { occurrence_id_allocator_advance_to, node_occurrence_identity_minted, occurrence_identity_consumer_red_debts, + occurrence_containment_path_is_prefix_of, } import v2.std.node { NodeOccurrenceId, @@ -157,3 +160,46 @@ test fn occurrence_identity_consumer_red_debt_is_counted_holds() -> Bool { id: "same-spelling-parser-declaration-isolation" ) } + +fn oi_path( + ancestors: List, + terminal: OccurrenceId +) -> OccurrenceContainmentPath { + OccurrenceContainmentPath { + ancestors: ancestors, + terminal: terminal, + } +} + +test fn occurrence_containment_path_prefix_equal_paths_holds() -> Bool { + let a = OccurrenceId { value: 1 } + let path = oi_path(ancestors: Empty, terminal: a) + occurrence_containment_path_is_prefix_of(prefix: path, path: path) +} + +test fn occurrence_containment_path_prefix_nested_ancestor_holds() -> Bool { + let a = OccurrenceId { value: 1 } + let x = OccurrenceId { value: 2 } + let prefix = oi_path(ancestors: Empty, terminal: a) + let nested = oi_path( + ancestors: Cons { head: a, tail: Empty }, + terminal: x, + ) + occurrence_containment_path_is_prefix_of(prefix: prefix, path: nested) +} + +test fn occurrence_containment_path_prefix_rejects_cross_branch_terminal_in_ancestors_holds() -> Bool { + let a = OccurrenceId { value: 1 } + let b = OccurrenceId { value: 2 } + let x = OccurrenceId { value: 3 } + let y = OccurrenceId { value: 4 } + let prefix = oi_path( + ancestors: Cons { head: a, tail: Empty }, + terminal: x, + ) + let other_branch = oi_path( + ancestors: Cons { head: b, tail: Cons { head: x, tail: Empty } }, + terminal: y, + ) + !occurrence_containment_path_is_prefix_of(prefix: prefix, path: other_branch) +} diff --git a/dag/test/claim/oomd_install_grounding_witness_test.dag b/dag/test/claim/oomd_install_grounding_witness_test.dag index 2d72b4f7a9c..4bb945557db 100644 --- a/dag/test/claim/oomd_install_grounding_witness_test.dag +++ b/dag/test/claim/oomd_install_grounding_witness_test.dag @@ -1,4 +1,56 @@ module test.claim.oomd_install_grounding_witness +import std.types { Bool } +import std.measure { + byte_size, + percent, +} +import std.realization_reconcile { + ShowEffectiveRead, + ReadObserved, + Grounding, + Grounds, + DoesNotGround, + reconciliation_converged, +} +import gunbc.oomd_install { + OomdEffectiveRead, + OomdGroundingThresholds, + OomdGroundingCheck, + GroundingPass, + GroundingFail, + SliceMembershipSignal, + ground_oomd_from_read, + membership_grounding_check, + reconcile_oomd, + oomd_evidence_from_reconciliation, + gunbc_oomd_install_evidence, + gunbc_oomd_fleet_evidence, +} +import gunbc.ci_floor_measurement { + OomdEnforcementEvidence, + OomdEnforced, + OomdUnverified, + CapEffective, + CapUnbounded, + SessionAggregateMeasured, + SessionAggregateUnmeasured, +} +import extdeps.systemd { + Active, + Inactive, +} +import extdeps.systemd.systemctl { + UnitEnabled, + UnitDisabled, +} +import extdeps.systemd.oomd { + ManagedOomKill, + ManagedOomAuto, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/os_free_witness_test.dag b/dag/test/claim/os_free_witness_test.dag index 882fca88597..401a8415c33 100644 --- a/dag/test/claim/os_free_witness_test.dag +++ b/dag/test/claim/os_free_witness_test.dag @@ -1,5 +1,18 @@ module test.claim.os_free_witness - +import extdeps.tools.free { + FreeOutput, + MemoryStats, + SwapStats, +} +import std.measure { + ByteSize, + byte_size, + byte_size_count, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/os_install_actuator_selection_witness_test.dag b/dag/test/claim/os_install_actuator_selection_witness_test.dag index 46492ce6f32..c733f5f6761 100644 --- a/dag/test/claim/os_install_actuator_selection_witness_test.dag +++ b/dag/test/claim/os_install_actuator_selection_witness_test.dag @@ -1,5 +1,37 @@ module test.claim.os_install_actuator_selection - +import std.bit { Bool } +import std.disposition { + Scaffold, + Terminal, +} +import gunbc.os_install_actuator_selection { + srv3_os_install_actuator_host, + srv3_os_install_actuator_host_is_derived_srv1, + srv3_os_install_actuator_host_selected_because_requirements_and_policy, + srv3_os_install_actuator_host_failover_fixture_selects_srv2, + srv3_os_install_actuator_selection_is_selected_on_live_fleet, + srv3_os_install_actuator_host_unsatisfiable_fallback_dissolution_trigger, + srv3_os_install_actuator_per_host_observation_forks_dissolution_trigger, + srv3_os_install_actuator_tie_break_policy, + os_install_actuator_requirement_satisfied, + os_install_actuator_requirement_kinds, + BmcNetworkReach, + ActuatorToolchainGrant, + live_srv3_actuator_reach_facts, + OperatorHostPreference, +} +import gunbc.fleet_intent { + srv1_host, + srv2_host, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/os_install_actuator_toolchain_grant_witness_test.dag b/dag/test/claim/os_install_actuator_toolchain_grant_witness_test.dag index c9ad69641dd..8348c5f8894 100644 --- a/dag/test/claim/os_install_actuator_toolchain_grant_witness_test.dag +++ b/dag/test/claim/os_install_actuator_toolchain_grant_witness_test.dag @@ -1,5 +1,21 @@ module test.claim.os_install_actuator_toolchain_grant - +import std.bit { Bool } +import std.types { list_length } +import extdeps.bmc.os_install_actuator_toolchain { + srv3_os_install_actuator_toolchain_grant, + srv3_os_install_actuator_host_label, + srv3_os_install_actuator_toolchain_is_complete, + actuator_toolchain_requirement_includes_tool, + extdeps_external_authority_anchor, +} +import extdeps.tools.curl { curl_cli_tool } +import extdeps.tools.websocat { websocat_cli_tool } +import extdeps.tools.nbdkit { nbdkit_cli_tool } +import extdeps.tools.socat { socat_cli_tool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/os_install_deduction_witness_test.dag b/dag/test/claim/os_install_deduction_witness_test.dag index 9c1ce4bdb0d..fc4ba1fb1d2 100644 --- a/dag/test/claim/os_install_deduction_witness_test.dag +++ b/dag/test/claim/os_install_deduction_witness_test.dag @@ -1,5 +1,56 @@ module test.claim.os_install_deduction - +import std.types { + Bool, + NonEmptyStr, +} +import extdeps.os.ubuntu_autoinstall { + UbuntuAutoinstallPayload, + AutoinstallIdentity, + NoCloudLocal, + StoragePolicyAbsent, + StoragePolicyDirectLayout, +} +import extdeps.uri { + Uri, + Https, +} +import gunbc.os_install { + srv3_ubuntu_autoinstall_on_iso, + srv3_autoinstall_identity, +} +import gunbc.os_install_emit { autoinstall_user_data } +import gunbc.os_install_deduction { + TargetDiskState, + EmptyDisk, + ForeignOsPresent, + UnknownDiskState, + OsInstallPreflightVerdict, + CompleteForUnattended, + RequiresStoragePolicy, + RequiresDiskObservation, + AutoinstallIncompleteNotBootable, + NotUnattendedByPolicy, + IncompleteSeedDelivery, + fold_nbd_proxy_os_install_preflight_verdict, + plan_for_os_install_preflight_verdict, + RemasterWithStoragePolicy, + RefuseUntilStoragePolicyDeclared, + RefuseNeedsDiskObservation, + KvmOperatorAttestation, + KvmObservedScreen, + SubiquityStorageScreen, + FirmwareSetup, + InstallerAwaitingStorage, + KvmFirmwareIdleObserved, + KvmSuggestsOsBooted, + RuntimeOsInstalled, + runtime_verdict_from_kvm_attestation, +} +import gunbc.fleet_intent_network { operator_host_srv3 } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/os_proc_meminfo_witness_test.dag b/dag/test/claim/os_proc_meminfo_witness_test.dag index eb6c7b69ebb..30aee531782 100644 --- a/dag/test/claim/os_proc_meminfo_witness_test.dag +++ b/dag/test/claim/os_proc_meminfo_witness_test.dag @@ -1,5 +1,18 @@ module test.claim.os_proc_meminfo_witness - +import extdeps.linux.proc_meminfo { + ProcMeminfo, + MemoryMetric, + meminfo_field_names, +} +import std.measure { + Kibibyte, + measure_count, +} +import std.types { NonEmptyStr } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/output_policy_witness_test.dag b/dag/test/claim/output_policy_witness_test.dag index af450ce9e2a..ed43046a9ed 100644 --- a/dag/test/claim/output_policy_witness_test.dag +++ b/dag/test/claim/output_policy_witness_test.dag @@ -1,4 +1,30 @@ module test.claim.output_policy_witness +import gunbc.output_policy { + ChannelPolicy, + ClaimResult, + Condensed, + Diagnostic, + Full, + Instrumentation, + Normal, + OutputDecision, + Progress, + Quiet, + ShellTrace, + Suppressed, + Verbose, + Verbosity, + VerbosityEnv, + channel_decision, + env_var_for, + resolve_channel_policy, + resolve_verbosity, + shell_trace_summary_max_columns, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/pareto_dominance_witness_test.dag b/dag/test/claim/pareto_dominance_witness_test.dag index 3d7864bb8fc..0651a395cce 100644 --- a/dag/test/claim/pareto_dominance_witness_test.dag +++ b/dag/test/claim/pareto_dominance_witness_test.dag @@ -1,4 +1,24 @@ module test.claim.pareto_dominance +import std.bit { Bool } +import std.types { List } +import std.pareto { + AxisComparison, + DominanceVerdict, + HigherIsBetter, + LowerIsBetter, + axis_comparison_int, + dominance_of_comparisons, + verdict_dominates, + verdict_is_dominated, + verdict_is_equivalent, + verdict_is_incomparable, + any_dominates, + on_pareto_front, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/parse_test.dag b/dag/test/claim/parse_test.dag index 12f584c10f0..2e4c2bc607a 100644 --- a/dag/test/claim/parse_test.dag +++ b/dag/test/claim/parse_test.dag @@ -1,5 +1,13 @@ module test.claim.parse_test - +import tools.parse_witness_transport { + run_parse_witness_floor, + run_parse_witness_perf, +} +import v2.std.logic { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/perturbation_kernel_test.dag b/dag/test/claim/perturbation_kernel_test.dag index 8963232f1b0..417998eb891 100644 --- a/dag/test/claim/perturbation_kernel_test.dag +++ b/dag/test/claim/perturbation_kernel_test.dag @@ -1,4 +1,19 @@ module test.claim.perturbation_kernel +import std.perturbation { + PerturbationReading, + ForwardSameInSameOut, + BackwardDiffInDiffOut, + ResponseConsistent, + ResponseViolation, + perturbation_verdict, + perturbation_is_violation, + perturbation_consistent, +} +import std.types { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/plan_lens_witness_test.dag b/dag/test/claim/plan_lens_witness_test.dag index d138faffa9a..86e0adb62b0 100644 --- a/dag/test/claim/plan_lens_witness_test.dag +++ b/dag/test/claim/plan_lens_witness_test.dag @@ -1,5 +1,19 @@ module test.claim.plan_lens_witness - +import gunbc.plan { + Plan, + DissolutionTrigger, + HasTrigger, + NoTrigger, + plan_has_dissolution_trigger, + plans_all_have_dissolution_trigger, + plan_title_is_present, + plans_all_titled, +} +import gunbc.plan_registry { all_plans } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/power_watt_witness_test.dag b/dag/test/claim/power_watt_witness_test.dag index 168b70537c4..b4a6e3f6243 100644 --- a/dag/test/claim/power_watt_witness_test.dag +++ b/dag/test/claim/power_watt_witness_test.dag @@ -1,4 +1,18 @@ module test.claim.power_watt +import std.bit { Bool } +import std.types { + Int, + List, +} +import std.measure { + Watt, + watt, + watt_count, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/python_pep440_version_witness_test.dag b/dag/test/claim/python_pep440_version_witness_test.dag index 9e317d41f19..4593693582f 100644 --- a/dag/test/claim/python_pep440_version_witness_test.dag +++ b/dag/test/claim/python_pep440_version_witness_test.dag @@ -1,4 +1,28 @@ module test.claim.python_pep440_version_witness +import std.algebra { Ordering } +import extdeps.version.pep440 { + Pep440Alpha, + Pep440PreRelease, + Pep440PublicVersion, + Pep440Version, + Pep440LocalLexicographic, + Pep440LocalNumeric, + Pep440CompatibleRelease, + Pep440InclusiveAtLeast, + Pep440ReleaseSegments, + pep440_compare_public, + pep440_version_identity, + pep440_version_specifier_constraint, + pep440_version_specifier_label, + pep440_version_label, + pep440_spec_url, + pep440_spec_label, + min_python_interpreter, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/random_bytes_csprng_witness_test.dag b/dag/test/claim/random_bytes_csprng_witness_test.dag index ff5a0c4cd6e..696168a805b 100644 --- a/dag/test/claim/random_bytes_csprng_witness_test.dag +++ b/dag/test/claim/random_bytes_csprng_witness_test.dag @@ -1,8 +1,26 @@ module test.claim.random_bytes_csprng_witness +import std.bit { Bool } +import std.types { + Int, + list_length, +} +import std.integer { UInt8 } +import std.encoding { + Base64Variant, + Standard, + UrlSafe, + base64_encode, + base64_decode, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import extdeps.entropy -data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly +data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly fn getrandom_octets(count: Int) -> List? { diff --git a/dag/test/claim/react_jsx_emit_test.dag b/dag/test/claim/react_jsx_emit_test.dag index 86ae476e52e..f68b5450e04 100644 --- a/dag/test/claim/react_jsx_emit_test.dag +++ b/dag/test/claim/react_jsx_emit_test.dag @@ -1,4 +1,19 @@ module test.claim.react_jsx_emit +import gunbc.gunbhub_serve { + gunbhub_browse_page, + gunbhub_hostile_page, +} +import extdeps.languages.react_jsx { + serialize_jsx_component, + try_serialize_jsx_component, + JsxEmitResult, + JsxOk, + JsxRejected, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/readback_independence_witness_test.dag b/dag/test/claim/readback_independence_witness_test.dag index 3b033a2900d..c8c980db4cb 100644 --- a/dag/test/claim/readback_independence_witness_test.dag +++ b/dag/test/claim/readback_independence_witness_test.dag @@ -1,4 +1,22 @@ module test.claim.readback_independence +import v2.std.live_tree { LiveTreeDisposition } +import gunbc.readback_independence { + ProbeEffectUnknown, + ReadBackProbe, + proc_swaps_read_probe, + readback_evidence_gate_accepts, + readback_evidence_trusting_widen_sketch, + readback_evidence_verdict, + readback_non_independent_probe_count, + readback_probe_is_independent, + readback_probe_roster, + sccache_show_stats_probe, + systemd_is_active_probe, + systemd_show_property_probe, +} +import gunbc.host_swap_backing { host_swap_backing_host_verdict } +import gunbc.host_phase_status { observation_verdict_eq } +import gunbc.fleet_intent_network { operator_host_srv3 } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/realization_reconcile_witness_test.dag b/dag/test/claim/realization_reconcile_witness_test.dag index 37d4c1868cd..93ccb5a1958 100644 --- a/dag/test/claim/realization_reconcile_witness_test.dag +++ b/dag/test/claim/realization_reconcile_witness_test.dag @@ -1,4 +1,29 @@ module test.claim.realization_reconcile_witness +import std.types { + Bool, + String, + List, +} +import std.effects { + CreateEffect, + CreateIfAbsent, + PostAlways, + InputField, +} +import std.realization { + RealizedStep, + LocalInProcess, + Materialization, + Recompute, + Memoize, + Share, + reconcile, +} +import std.realization_schedule { cost_account_predicted_zero } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/realization_scale_agnostic_test.dag b/dag/test/claim/realization_scale_agnostic_test.dag index 9432fc5ba7b..ee33c45496d 100644 --- a/dag/test/claim/realization_scale_agnostic_test.dag +++ b/dag/test/claim/realization_scale_agnostic_test.dag @@ -1,4 +1,30 @@ module test.claim.realization_scale_agnostic +import std.types { + Bool, + List, +} +import std.nat { Nat } +import std.measure { + Measure, + Milli, + time_measure, + measure_count, +} +import std.realization_schedule { + CostAccount, + cost_account_time_count, +} +import std.realization_measurement { + time_measure_seq, + time_measure_par, + schedule_critical_path_time, + cost_account_measured_from_schedule_critical_path, + witness_measured_rollup_differs_from_predicted_zero, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/realization_schedule_critical_path_test.dag b/dag/test/claim/realization_schedule_critical_path_test.dag index 44cd42f63fa..caa872d3487 100644 --- a/dag/test/claim/realization_schedule_critical_path_test.dag +++ b/dag/test/claim/realization_schedule_critical_path_test.dag @@ -1,4 +1,31 @@ module test.claim.realization_schedule_critical_path +import std.verification { + NanosecondDuration, + nanosecond_duration, + nanosecond_duration_count, +} +import std.realization_measurement { + schedule_batch_critical_path, + schedule_critical_path_time, + cost_account_measured_from_schedule_critical_path, + time_measure_list_total, +} +import std.realization_schedule { + CostBasis, + cost_account_time_count, +} +import std.nat { + nat_compare, + nat_max, +} +import std.algebra { + Greater, + Equal, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/realization_schedule_witness_test.dag b/dag/test/claim/realization_schedule_witness_test.dag index 98c1e7b7d37..a7364612841 100644 --- a/dag/test/claim/realization_schedule_witness_test.dag +++ b/dag/test/claim/realization_schedule_witness_test.dag @@ -1,6 +1,6 @@ module test.claim.realization_schedule_witness - import v2.workflow.ci_floor_plan { cheap_floor_gate_step_labels } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = ReadsLiveTree diff --git a/dag/test/claim/realization_width_witness_test.dag b/dag/test/claim/realization_width_witness_test.dag index 078f04c2f3e..8477f720ca5 100644 --- a/dag/test/claim/realization_width_witness_test.dag +++ b/dag/test/claim/realization_width_witness_test.dag @@ -1,5 +1,40 @@ module test.claim.realization_width_witness - +import std.nat { Nat } +import std.measure { + HardwareThreadCount, + Nano, + hardware_thread_count, + hardware_thread_count_value, +} +import std.realization_schedule { + RealizationPlan, + RealizationObjective, + Runnable, + RunnableSingleClaim, + CostAccount, + cost_account_predicted_zero, + runnable_resource_profile_negligible, +} +import std.realization_width { + bounded_host_spawn_width, + witness_spawn_width_capped_by_hardware, + witness_width_fold_preserves_schedule_topology, + witness_budget_ignoring_fold_fails, + witness_measured_cost_affects_shard_balance, + witness_memory_term_non_binding_uses_shard_count, + witness_tight_budget_backs_off_below_shard_count, + witness_unreadable_budget_falls_back_conservative, + witness_safety_fraction_is_load_bearing, + witness_subunit_budget_admits_one, + witness_pids_term_binds_below_cores_and_memory, + witness_memory_term_still_binds_under_three_term_fold, + witness_unreadable_pids_budget_falls_back_conservative, + witness_subunit_pids_budget_admits_one, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/realization_witness_test.dag b/dag/test/claim/realization_witness_test.dag index 48a4364706e..cf8c69b51bc 100644 --- a/dag/test/claim/realization_witness_test.dag +++ b/dag/test/claim/realization_witness_test.dag @@ -1,4 +1,23 @@ module test.claim.realization_witness +import std.effects { + ReadEffect, + CreateEffect, + PostAlways, + UpsertEffect, + DeleteEffect, + PathParam, + InputField, +} +import std.realization { + Unknown, + Dependent, + Independent, + independence_from_effect_shapes, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/realize_kernel_test.dag b/dag/test/claim/realize_kernel_test.dag index 6c814105483..ff7919afc21 100644 --- a/dag/test/claim/realize_kernel_test.dag +++ b/dag/test/claim/realize_kernel_test.dag @@ -1,4 +1,41 @@ module test.claim.realize_kernel +import std.types { + Bool, + ContentHash, +} +import std.cache_identity { + CacheInterfaceId, + ArtifactKindId, + ExecutionReceiptDigest, + resolved_graph_artifact_kind, +} +import std.cache_interface { + ArtifactIdentity, + ExecutionReceiptRef, + InternalExecution, + BackendCacheKey, + CasContentDigest, + CachedArtifactReceipt, + Hit, + Miss, + RejectedHit, + ContentDigestMismatch, + Reuse, + Recompute, + SubjectAbsent, + HitRefused, + Written, + WriteSkippedIdempotent, + WriteRejected, + WriteOnceConflict, + BackendWriteRejected, + realize_route, + classify_write, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/reconcile_in_process_cache_test.dag b/dag/test/claim/reconcile_in_process_cache_test.dag index a3dd33f3dc7..f2a86133acc 100644 --- a/dag/test/claim/reconcile_in_process_cache_test.dag +++ b/dag/test/claim/reconcile_in_process_cache_test.dag @@ -1,4 +1,42 @@ module test.claim.reconcile_in_process_cache +import std.types { + Bool, + ContentHash, +} +import std.cache_identity { + parse_source_artifact_kind, + typed_module_artifact_kind, + resolved_graph_artifact_kind, +} +import std.cache_interface { + ArtifactIdentity, + HandAuthoredString, + NativeInternalHash, + ContentAddressedByValue, + PerHostFilesystem, + InProcess, + StructuredArtifact, + MissThenCreate, +} +import extdeps.cache { + cache_interface_facts_from_catalog, + cache_key_projection_transport, +} +import extdeps.cache.types { catalog_key_derivation_classification } +import extdeps.realization.reconcile_in_process { + parse_cache_facts, + typed_module_cache_facts, + parse_cache_id, + typed_module_cache_id, +} +import extdeps.realization.resolved_graph { + resolved_graph_cache_facts, + resolved_graph_cache_id, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/render_glyphs_ansi_witness_test.dag b/dag/test/claim/render_glyphs_ansi_witness_test.dag index 8d4a029b4d1..f3e5afa0adf 100644 --- a/dag/test/claim/render_glyphs_ansi_witness_test.dag +++ b/dag/test/claim/render_glyphs_ansi_witness_test.dag @@ -1,4 +1,27 @@ module test.claim.render_glyphs_ansi_witness +import extdeps.render.ansi { ansi_code } +import extdeps.render.glyph { glyph } +import extdeps.render.glyphs { + resolve_symbol, + symbol_color, +} +import extdeps.render.tier_glyphs { + glyph_at, + glyphs_for_tiers, +} +import std.symbols { + Ascii, + Emoji, + Error, + NodeCompleted, + NodeFailed, + Success, + Unicode, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/render_repeat_string_witness_test.dag b/dag/test/claim/render_repeat_string_witness_test.dag index 6084af91ff1..be2faa638fa 100644 --- a/dag/test/claim/render_repeat_string_witness_test.dag +++ b/dag/test/claim/render_repeat_string_witness_test.dag @@ -1,5 +1,10 @@ module test.claim.render_repeat_string_witness_test - +import std.render_repeat_string_bootstrap { repeat_string } +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/render_surface_witness_test.dag b/dag/test/claim/render_surface_witness_test.dag index ea696d86668..ce498510be8 100644 --- a/dag/test/claim/render_surface_witness_test.dag +++ b/dag/test/claim/render_surface_witness_test.dag @@ -1,4 +1,31 @@ module test.claim.render_surface_witness +import std.render { + Document, + Block, + Leaf, + Group, + Line, + Span, + SpanStyle, + RenderCapability, + Append, +} +import std.materialization_ladder { Frame } +import std.symbols { Ascii } +import extdeps.render.surface { + RenderTarget, + PlainTerminal, + GithubActions, + SurfaceEnv, + detect_target, + group_syntax, + resolve_group_syntax, + serialize_document, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/resolution_divergence_silent_pick_gate_witness_test.dag b/dag/test/claim/resolution_divergence_silent_pick_gate_witness_test.dag index 9104b99dc76..3ef25832c0a 100644 --- a/dag/test/claim/resolution_divergence_silent_pick_gate_witness_test.dag +++ b/dag/test/claim/resolution_divergence_silent_pick_gate_witness_test.dag @@ -1,5 +1,6 @@ module test.claim.resolution_divergence_silent_pick_gate_witness_test - +import v2.std.live_tree { LiveTreeDisposition } +import tools.resolution_divergence_silent_pick_gate_witness_transport { run_resolution_divergence_silent_pick_gate_witness } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/resource_namespace_upsert_witness_test.dag b/dag/test/claim/resource_namespace_upsert_witness_test.dag index dceb5ef736a..c0b0ef2e18c 100644 --- a/dag/test/claim/resource_namespace_upsert_witness_test.dag +++ b/dag/test/claim/resource_namespace_upsert_witness_test.dag @@ -1,5 +1,53 @@ module test.claim.resource_namespace_upsert - +import std.types { + Bool, + NonEmptyStr, + Int, +} +import std.upsert_decision { + UpsertClassification, + Converged, + Drifted, + Absent, + Conflict, + Noop, + Apply, + Refuse, +} +import gunbc.file_access { + FileTreeScope, + FileAccessObservation, + PathOutsideNamespace, + ReadOnlyWithinNamespace, + WritableWithinNamespace, + ChmodOwnerWriteWithinTempTree, + CreateParent, + classify_file_access_upsert, + path_within_file_tree_scope, +} +import gunbc.session_lease { + ProcessPortScope, + ProcessPortObservation, + PortObserved, + PortObservedStaleExpected, + DrainMatchingStaleThenStart, + classify_process_port_upsert, +} +import gunbc.install_media { + SeededInstallMediaObservation, + MediaAbsent, + MediaConverged, + MediaDrifted, + SeededInstallMediaPlan, + Remaster, + ReplaceAtomically, + classify_seeded_install_media, + classify_seeded_install_media_upsert, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/reviewer_source_witness_test.dag b/dag/test/claim/reviewer_source_witness_test.dag index 3680afd2870..518455d2e3b 100644 --- a/dag/test/claim/reviewer_source_witness_test.dag +++ b/dag/test/claim/reviewer_source_witness_test.dag @@ -1,4 +1,19 @@ module test.claim.reviewer_source_witness_test +import gunbc.review_verdict { + LlmReviewProvider, + Reviewer, + reviewer_source, +} +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import std.types { NonEmptyStr } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/roadmap_gate_test.dag b/dag/test/claim/roadmap_gate_test.dag index e22d1b37fd1..729dba37aaf 100644 --- a/dag/test/claim/roadmap_gate_test.dag +++ b/dag/test/claim/roadmap_gate_test.dag @@ -1,4 +1,26 @@ module test.claim.roadmap_gate +import extdeps.languages.markdown { serialize_markdown_source } +import gunbc.roadmap_document { + RoadmapDocument, + RoadmapSection, + project_roadmap_to_markdown, +} +import gunbc.roadmap_model { + RoadmapNode, + SectionElement, + section_group, +} +import gunbc.roadmap_authority { + expected_roadmap_md, + roadmap_drifted, + derivable, + sign, + signed, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/roadmap_site_healthz_json_parse_witness.dag b/dag/test/claim/roadmap_site_healthz_json_parse_witness.dag index ada1b05f2a2..a89500ddec5 100644 --- a/dag/test/claim/roadmap_site_healthz_json_parse_witness.dag +++ b/dag/test/claim/roadmap_site_healthz_json_parse_witness.dag @@ -1,5 +1,14 @@ module test.claim.roadmap_site_healthz_json_parse_witness - +import std.process { + ProcessExit, + ExitSuccess, + exit_failure, +} +import gunbc.roadmap_site_healthz_validate { + roadmap_site_healthz_body_parses, + roadmap_site_healthz_json_string_parses, +} +import gunbc.roadmap_static_site { roadmap_site_healthz_body } func roadmap_site_healthz_json_parse_witness() -> ProcessExit { let body = roadmap_site_healthz_body() diff --git a/dag/test/claim/roadmap_status_test.dag b/dag/test/claim/roadmap_status_test.dag index 5c79fb3e4f0..aaea4e00c2e 100644 --- a/dag/test/claim/roadmap_status_test.dag +++ b/dag/test/claim/roadmap_status_test.dag @@ -1,4 +1,33 @@ module test.claim.roadmap_status +import extdeps.github.pulls { + PullRequest, + PullRequestRef, + Open, +} +import extdeps.github.github { + GitHubUser, + User, +} +import gunbc.roadmap_status { + RoadmapItem, + DerivableLine, + AuthoredLine, + DriftVerdict, + Drifted, + Clean, + Underivable, + pr_merged, + merged_pr_numbers, + prs_all_merged, + item_is_done, + status_drift, + item_drifted, + item_drifts_against_prs, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/runnable_resource_profile_witness_test.dag b/dag/test/claim/runnable_resource_profile_witness_test.dag index c55bb0d4b8c..995f3c6a1a1 100644 --- a/dag/test/claim/runnable_resource_profile_witness_test.dag +++ b/dag/test/claim/runnable_resource_profile_witness_test.dag @@ -1,4 +1,31 @@ module test.claim.runnable_resource_profile +import std.realization_schedule { + SelectionOff, + Runnable, + RunnableSingleClaim, + RunnableDiscoveryBatch, + runnable_resource_profile, + runnable_resource_profile_negligible, + runnable_resource_profile_eq, + runnable_memory_negligible, + runnable_memory_substantial, + runnable_memory_class_eq, + runnable_forbids_corpus_co_residence, + runnable_heavy_whole_tree_resolve, +} +import std.execution_mode { + Hermetic, + Wet, + execution_mode_eq, +} +import std.measure { + byte_size, + byte_size_count, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/runner_placement_witness_test.dag b/dag/test/claim/runner_placement_witness_test.dag index b03e4c77b51..0d3110a9ed4 100644 --- a/dag/test/claim/runner_placement_witness_test.dag +++ b/dag/test/claim/runner_placement_witness_test.dag @@ -1,4 +1,75 @@ module test.claim.runner_placement_witness +import gunbc.ci_runner_placement { + RunnerDeploymentPlan, + PlanDerived, + PlanUnsound, + RunnerHostDeployment, + runner_deployment_plan, + SessionSliceResolution, + SessionSliceResolved, + SessionSliceUnresolved, + resolve_session_slice, + SessionReservationPlan, + SessionReservationDerived, + SessionReservationUnsound, + session_reservation_plan, + SessionHostReservation, + RunnersPerHostResolution, + RunnersPerHostDerived, + RunnersPerHostUnsound, + effective_runners_per_host, + OperatingPointRow, + evaluate_operating_point, + operating_curve, + samples_covered, + WorkloadClass, + BatchLatencyTolerant, + InteractiveLatencySensitive, + workload_class_cpu_weight, +} +import gunbc.fleet_host_budget { + declared_runner_count, + gunbc_runner_pool_budget, +} +import gunbc.ci_floor_measurement { + gunbc_ci_runner_cgroup_memory_cap, + SessionOperatingPointSet, + SessionAggregateMeasured, + SessionAggregateUnmeasured, + OomdEnforced, + OomdUnverified, + Regime1WorstCase, + Regime2AggregateOomd, + SessionReservationModeUnset, +} +import gunbc.ci_fleet { fleet_intent_offers } +import gunbc.runner_deploy_emit { + expected_runner_deploy_manifest, + expected_runner_deploy_manifest_json, + runner_deploy_drifted, + manifest_host_doc, + manifest_host_fields, + session_host_doc, + runner_deploy_protocol, +} +import std.languages { json_record_knobs } +import std.serialize { serialize_record_doc } +import std.layout { render } +import std.measure { + byte_size, + byte_size_count, + hardware_thread_count_value, +} +import std.types { + Bool, + Int, + List, + String, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/runner_slot_enforcement_grounding_witness_test.dag b/dag/test/claim/runner_slot_enforcement_grounding_witness_test.dag index c5ba5f80991..e094842409e 100644 --- a/dag/test/claim/runner_slot_enforcement_grounding_witness_test.dag +++ b/dag/test/claim/runner_slot_enforcement_grounding_witness_test.dag @@ -1,4 +1,49 @@ module test.claim.runner_slot_enforcement_grounding_witness +import std.types { + Bool, + NonEmptyStr, + String, +} +import std.measure { + ByteSize, + byte_size, + byte_size_count, +} +import std.realization_reconcile { + ShowEffectiveRead, + ReadObserved, + reconciliation_converged, +} +import gunbc.ci_floor_measurement { + RunnerSliceCapEffectiveness, + CapEffective, + CapUnbounded, + gunbc_ci_runner_cgroup_memory_cap, +} +import gunbc.runner_slot_enforcement { + RunnerSlotEnforcement, + RunnerSlotEnforced, + RunnerSlotUnenforced, + RunnerSlotApplyEffect, + runner_slot_apply_effect, + reconcile_runner_slot, + runner_slot_evidence_from_reconciliation, + runner_slot_enforcement_evidence, + runner_slot_enforcement_from_unit_read, + gunbc_runner_slot_enforcement_committed, + gunbc_runner_per_slot_enforcement_committed, +} +import gunbc.runner_unit_live_read { + RunnerUnitLiveReadRow, + runner_unit_live_read_typed, + gunbc_srv1_runner_unit_live_read_fixture, +} +import gunbc.runner_slot_allocation { gunbc_runner_slot_enforcement_expected_cap } +import gunbc.fleet_show_effective_read { gunbc_fleet_runner_slice_cap_show_effective_read } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/runner_unit_live_read_witness_test.dag b/dag/test/claim/runner_unit_live_read_witness_test.dag index eb3ae2e17b5..d84ce9710ee 100644 --- a/dag/test/claim/runner_unit_live_read_witness_test.dag +++ b/dag/test/claim/runner_unit_live_read_witness_test.dag @@ -1,4 +1,59 @@ module test.claim.runner_unit_live_read_witness +import std.types { + Bool, + String, +} +import std.measure { + ByteSize, + byte_size, + byte_size_count, +} +import extdeps.systemd { + SystemdCgroupMemoryLimit, + MemoryLimitUnbounded, + MemoryLimitBytes, + MemoryLimitAbsent, + parse_systemd_memory_limit_show, + systemd_memory_max_property, + systemd_memory_swap_max_property, + systemd_memory_high_property, +} +import gunbc.host_converge { + ConvergeTarget, + PerSlotMemoryCap, + ConvergeVerdict, + VerdictConverged, + Drifted, + Absent, + gunbc_runner_per_slot_dropin_path, + gunbc_runner_per_slot_swap_dropin_path, + gunbc_runner_per_slot_high_dropin_path, + runner_instance_glob, +} +import gunbc.ci_floor_measurement { + gunbc_ci_runner_cgroup_memory_cap, + RunnerSliceCapEffectiveness, + CapEffective, + CapUnbounded, +} +import gunbc.runner_unit_live_read { + RunnerUnitLiveReadRow, + RunnerUnitMemoryLiveRead, + gunbc_srv1_runner_unit_live_read_fixture, + runner_unit_live_read_typed, + memory_limit_to_cap_effectiveness, + memory_limit_converge_verdict, + memory_limit_converge_verdict_for_bytes_value, + converge_target_live_verdict, + runner_unit_memory_max_drifts_against_cap, + runner_unit_swap_max_converged, + fixture_live_read, +} +import gunbc.runner_slot_allocation { gunbc_runner_slot_desired } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/sccache_local_content_verified_on_read_test.dag b/dag/test/claim/sccache_local_content_verified_on_read_test.dag index 3f33d34a6c1..d7a445c4959 100644 --- a/dag/test/claim/sccache_local_content_verified_on_read_test.dag +++ b/dag/test/claim/sccache_local_content_verified_on_read_test.dag @@ -1,4 +1,9 @@ module test.claim.sccache_local_content_verified_on_read +import std.cache_interface { CacheEvidence } +import v2.std.live_tree { LiveTreeDisposition } +import extdeps.realization.resolved_graph { resolved_graph_cache_facts } +import extdeps.cache.sccache { sccache_local_facts } +import extdeps.cache { sccache_local_projected } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/sec_edgar_rollins_chemed_witness_test.dag b/dag/test/claim/sec_edgar_rollins_chemed_witness_test.dag index fd303bc5ad1..d97951104d6 100644 --- a/dag/test/claim/sec_edgar_rollins_chemed_witness_test.dag +++ b/dag/test/claim/sec_edgar_rollins_chemed_witness_test.dag @@ -1,5 +1,4 @@ module test.claim.sec_edgar_rollins_chemed_witness - import extdeps.sec.facts { FiledMonetaryFact, derive_gross_margin_ratio_from_facts, @@ -19,6 +18,7 @@ import extdeps.sec.issuer.chemed_facts { } import extdeps.sec.issuer.chemed { chemed_cik } import extdeps.sec.edgar { cik_padded_digits } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/sec_edgar_witness_test.dag b/dag/test/claim/sec_edgar_witness_test.dag index de78f17896e..7bea06c1fc0 100644 --- a/dag/test/claim/sec_edgar_witness_test.dag +++ b/dag/test/claim/sec_edgar_witness_test.dag @@ -1,5 +1,4 @@ module test.claim.sec_edgar_witness - import extdeps.sec.facts { derive_gross_margin_ratio_from_facts, filed_amount, @@ -15,6 +14,7 @@ import extdeps.sec.issuer.gitlab_facts { } import extdeps.sec.issuer.gitlab { gitlab_cik } import extdeps.sec.edgar { cik_padded_digits } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/shell_bash_runner_witness_test.dag b/dag/test/claim/shell_bash_runner_witness_test.dag index d1de5231d06..6714f813393 100644 --- a/dag/test/claim/shell_bash_runner_witness_test.dag +++ b/dag/test/claim/shell_bash_runner_witness_test.dag @@ -1,5 +1,14 @@ module test.claim.shell_bash_runner - +import gunbc.shell_bash_runner { + shell_bash_runner_dissolution_trigger, + shell_exec_via_bash, + shell_printf_line, + gunbc_bash_heredoc_delimiter, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_bmc_credential_resolve_witness_test.dag b/dag/test/claim/srv3_bmc_credential_resolve_witness_test.dag index ee928d61620..93a21ed07b9 100644 --- a/dag/test/claim/srv3_bmc_credential_resolve_witness_test.dag +++ b/dag/test/claim/srv3_bmc_credential_resolve_witness_test.dag @@ -1,5 +1,22 @@ module test.claim.srv3_bmc_credential_resolve - +import std.bit { Bool } +import gunbc.srv3_bmc_credential_resolve { + srv3_os_install_actuate_credential_intent, + resolve_bmc_credential, + bmc_credential_resolution_uses_factory, + bmc_credential_resolution_uses_secret_ref, + CredentialResolutionRefused, +} +import gunbc.bmc_onboarding { + FactoryCredentialActive, + RotatedCredentialActive, + CredentialStateUnknown, +} +import gunbc.assimilate.bmc_wif_delegation_chain { bmc_srv3_admin_secret_ref } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_boot_once_cd_witness_test.dag b/dag/test/claim/srv3_boot_once_cd_witness_test.dag index 124f353ede8..50405ff7f84 100644 --- a/dag/test/claim/srv3_boot_once_cd_witness_test.dag +++ b/dag/test/claim/srv3_boot_once_cd_witness_test.dag @@ -1,5 +1,31 @@ module test.claim.srv3_boot_once_cd - +import std.bit { Bool } +import extdeps.bmc.types { + BootTargetCd, + BootOverrideOnce, + BootOverrideModeUefi, + ResetForceRestart, + redfish_boot_target_wire, + redfish_boot_override_enabled_wire, + redfish_boot_override_mode_wire, + redfish_reset_type_wire, +} +import gunbc.tools.bmc_onboard { + boot_override_body, + reset_body, +} +import gunbc.srv3_boot_once_cd { + srv3_boot_cd_target, + srv3_boot_cd_enabled, + srv3_boot_cd_mode, + srv3_boot_cd_reset_type, + srv3_boot_cd_override_mode_valid_for_arm64, + srv3_boot_cd_override_mode_refusal, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_host_effect_apply_witness_test.dag b/dag/test/claim/srv3_host_effect_apply_witness_test.dag index 96536fd0d6d..9426efd6700 100644 --- a/dag/test/claim/srv3_host_effect_apply_witness_test.dag +++ b/dag/test/claim/srv3_host_effect_apply_witness_test.dag @@ -1,4 +1,65 @@ module test.claim.srv3_host_effect_apply_witness +import std.bit { Bool } +import std.types { NonEmptyStr } +import gunbc.host_effect { + HostEffect, + NodeControlPlane, + BmcController, + host_effect_identity_evidence, + host_effect_read_evidence, + SshShell, + ConvergePlanApplied, + Srv3InstallMediaFetch, + Srv3SeededInstallMediaRemaster, + Srv3SeededInstallMediaToolchainEnsure, + Srv3BmcwebSessionLogin, + Srv3BmcwebTokenExtract, + Srv3NbdProxyServe, + Srv3BootOnceReadBackSleep, + Srv3ReceiptEmit, +} +import gunbc.host_effect_realize { host_effect_apply } +import gunbc.os_install_actuator_selection { srv3_os_install_actuator_host } +import std.realization_reconcile { + reconciliation_converged, + NotConverged, +} +import gunbc.srv3_nbd_proxy_serve_intent { srv3_nbd_proxy_serve_host_effect } +import gunbc.host_effect_nbd_proxy_serve { + host_effect_nbd_proxy_serve_dissolution_trigger, + host_effect_nbd_proxy_serve_session_binding, + host_effect_nbd_proxy_serve_session_policy_is_held_lease, + host_effect_nbd_proxy_serve_apply_with_observation, + host_effect_nbd_proxy_serve_apply_refuses_foreign_port, + host_effect_nbd_proxy_serve_apply_drains_stale_matching, + host_effect_nbd_proxy_serve_apply_refuses_when_observe_unimplemented, + host_effect_nbd_proxy_serve_websocat_argv_materialized_omits_shell_env_ref, + NbdProxyServeApplyRefused, +} +import gunbc.session_lease { + PortObserved, + PortObservedStaleExpected, +} +import gunbc.srv3_host_effect_apply { + srv3_typed_receipt_from_lines, + srv3_typed_receipt, + srv3_shell_stdout_from_apply, +} +import gunbc.shell_bash_runner { shell_bash_runner_dissolution_trigger } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} +import extdeps.bmc.webui.nbd_proxy_serve { + bmcweb_session_login_argv, + bmcweb_session_login_curl_args, +} +import extdeps.tools.curl { curl_cli_tool } +import extdeps.boards.asrock_rack { asrock_srv3_live_bmc_host } +import gunbc.srv3_actuate_shell_paths { + srv3_bmcweb_login_body_path, + srv3_bmcweb_login_response_path, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_install_media_fetch_witness_test.dag b/dag/test/claim/srv3_install_media_fetch_witness_test.dag index 444c1ade0bf..2c7dc80c8f1 100644 --- a/dag/test/claim/srv3_install_media_fetch_witness_test.dag +++ b/dag/test/claim/srv3_install_media_fetch_witness_test.dag @@ -1,5 +1,40 @@ module test.claim.srv3_install_media_fetch - +import std.bit { Bool } +import std.disposition { + Scaffold, + Terminal, +} +import std.effects { + CreateEffect, + CreateIfAbsent, + InputField, +} +import gunbc.srv3_ubuntu_install_media_artifact { srv3_ubuntu_install_media_artifact } +import gunbc.srv3_install_media_fetch { + srv3_ubuntu_install_media_install_path, + install_media_fetch_effect_shape, + classify_install_media_fetch, + install_media_fetch_verdict_is_idempotent_skip, + install_media_fetch_first_mirror_url, + srv3_install_media_fetch_install_path_is_versioned, + srv3_install_media_fetch_actuator_host_is_srv1, + srv3_install_media_fetch_shell_runner_scaffold, + Absent, + Present, + AlreadyPresent, + FetchRequired, + HashMismatchRefusal, +} +import extdeps.provisioning.ubuntu_install_media { + CdimageUbuntuCom, + ReleasesUbuntuCom, + ubuntu_install_media_mirror_rows, +} +import extdeps.provisioning.ubuntu_install_media_fetch { install_media_fetch_bash_emit_dissolution_trigger } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_install_server_emit_test.dag b/dag/test/claim/srv3_install_server_emit_test.dag index 0c00e0fddab..de85211ded4 100644 --- a/dag/test/claim/srv3_install_server_emit_test.dag +++ b/dag/test/claim/srv3_install_server_emit_test.dag @@ -1,5 +1,27 @@ module test.claim.srv3_install_server_emit - +import std.bit { Bool } +import gunbc.install_server_emit { install_server_dnsmasq_conf } +import gunbc.os_install { srv3_install_server_spec } +import extdeps.toolchain.types { + Aarch64, + X86_64, + Riscv64, +} +import extdeps.provisioning.network_boot { UefiHttpBoot } +import extdeps.uri { + Uri, + Https, +} +import extdeps.provisioning.dhcp_client_arch { + dhcp_client_processor_architecture, + dhcp_processor_architecture_code, + HttpBootArm64, + HttpBootX86_64, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_network_identity_subsumption_witness_test.dag b/dag/test/claim/srv3_network_identity_subsumption_witness_test.dag index 999c7ff0d94..c42b004a616 100644 --- a/dag/test/claim/srv3_network_identity_subsumption_witness_test.dag +++ b/dag/test/claim/srv3_network_identity_subsumption_witness_test.dag @@ -1,5 +1,24 @@ module test.claim.srv3_network_identity_subsumption - +import std.bit { Bool } +import std.disposition { + Scaffold, + Terminal, +} +import gunbc.network_identity_subsumption { + srv3_pre_install_has_no_os_up_subsumption, + srv3_post_install_fixture_subsumes_fleet_slot, + bmc_static_reservation_does_not_subsume_os_fleet_slot, + network_identity_subsumes_fleet_slot, + srv3_os_lan_mac_dissolution_trigger, + srv3_os_lan_ipv4_dissolution_trigger, + srv3_bmc_static_lease_row, + srv3_os_up_dynamic_lease_row, +} +import gunbc.fleet_intent_network { operator_host_srv3 } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_os_install_actuate_scope_witness_test.dag b/dag/test/claim/srv3_os_install_actuate_scope_witness_test.dag index 5fa56ae8b8a..c1966699164 100644 --- a/dag/test/claim/srv3_os_install_actuate_scope_witness_test.dag +++ b/dag/test/claim/srv3_os_install_actuate_scope_witness_test.dag @@ -1,5 +1,19 @@ module test.claim.srv3_os_install_actuate_scope - +import std.bit { Bool } +import gunbc.srv3_os_install_actuate_scope { + srv3_autoinstall_seed_delivery_refusal, + srv3_autoinstall_seed_gap_is_fail_closed, + srv3_os_install_actuate_credential_resolution_is_wired, + srv3_os_install_actuate_credential_debt_grounds_bmc_secret_ref, + srv3_actuator_prep_uses_seeded_autoinstall_delivery, + srv3_actuator_prep_binds_seeded_iso_path, + srv3_os_install_actuate_is_actuator_prep_not_install_solved, +} +import gunbc.os_install { fleet_install_server_specs } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_os_install_actuate_witness_test.dag b/dag/test/claim/srv3_os_install_actuate_witness_test.dag index 71393c65df7..d05f009e5e4 100644 --- a/dag/test/claim/srv3_os_install_actuate_witness_test.dag +++ b/dag/test/claim/srv3_os_install_actuate_witness_test.dag @@ -1,5 +1,43 @@ module test.claim.srv3_os_install_actuate - +import std.bit { Bool } +import std.disposition { + Scaffold, + Terminal, +} +import gunbc.srv3_os_install_actuate { + srv3_os_install_actuator_step_count_is_three, + srv3_os_install_actuate_runbook_is_declared, + srv3_os_install_actuate_shell_runner_scaffold, + srv3_bmcweb_login_body_content, +} +import gunbc.srv3_nbd_proxy_serve_intent { srv3_nbd_proxy_serve_intent } +import gunbc.srv3_actuate_shell_paths { srv3_bmcweb_token_path } +import gunbc.srv3_os_install_actuate_scope { srv3_actuator_virtual_media_iso_install_path } +import extdeps.bmc.webui.nbd_proxy { + VmSlotIndexEndpoint, + bmcweb_nbd_proxy_ws_path, +} +import extdeps.tools.websocat { websocat_install_path } +import extdeps.bmc.webui.nbd_proxy_serve { + nbd_proxy_serve_websocat_argv, + nbd_proxy_serve_nbdkit_argv, + nbd_proxy_serve_has_no_shell_supervision_grammar, +} +import extdeps.boards.asrock_rack { + asrock_srv3_live_bmc_host, + asrock_altrad8ud_openbmc_2_07_00_nbd_proxy_primary_endpoint, +} +import gunbc.nbd_proxy_virtual_media_install { srv3_os_install_actuator_plan } +import gunbc.os_install_mechanism { + NbdProxyVirtualMediaInstall, + PxeHttpInstall, + VirtualMediaInstall, + FirmwareUpdateThenVirtualMedia, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_os_install_actuate_workflow_witness_test.dag b/dag/test/claim/srv3_os_install_actuate_workflow_witness_test.dag index 06fdddb463b..3b6ed817656 100644 --- a/dag/test/claim/srv3_os_install_actuate_workflow_witness_test.dag +++ b/dag/test/claim/srv3_os_install_actuate_workflow_witness_test.dag @@ -1,5 +1,21 @@ module test.claim.srv3_os_install_actuate_workflow - +import std.bit { Bool } +import gunbc.srv3_os_install_actuate_workflow { + srv3_boot_once_cd_escalation, + srv3_boot_once_cd_default_approval, + srv3_boot_once_cd_operator_granted_approval, + srv3_boot_once_cd_is_runnable_with_approval, + srv3_os_install_actuate_workflow_includes_operator_approval_before_boot, + srv3_os_install_actuate_workflow_credential_intent_is_declared, +} +import gunbc.workflow_escalation { + PendingApproval, + ApprovalGranted, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_os_install_actuator_toolchain_ensure_witness_test.dag b/dag/test/claim/srv3_os_install_actuator_toolchain_ensure_witness_test.dag index 2c9c3d52b0a..69e9c251d9f 100644 --- a/dag/test/claim/srv3_os_install_actuator_toolchain_ensure_witness_test.dag +++ b/dag/test/claim/srv3_os_install_actuator_toolchain_ensure_witness_test.dag @@ -1,5 +1,23 @@ module test.claim.srv3_os_install_actuator_toolchain_ensure - +import std.bit { Bool } +import std.disposition { + Scaffold, + Terminal, + RealizationDispatch, +} +import gunbc.srv3_os_install_actuator_toolchain_ensure { + os_install_actuator_toolchain_ensure_dissolution_trigger, + os_install_actuator_toolchain_ensure_routes_through_host_effect_apply, +} +import gunbc.host_effect_realize { + srv3_actuator_toolchain_realizer_apt_install_is_privileged_gated, + srv3_actuator_toolchain_realizer_websocat_uses_github_release_not_apt, + srv3_actuator_toolchain_realizer_websocat_installs_to_modeled_path_with_namespace_upsert, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_os_install_diagnostic_witness_test.dag b/dag/test/claim/srv3_os_install_diagnostic_witness_test.dag index 4c8e5bdcfdf..2552fff2b08 100644 --- a/dag/test/claim/srv3_os_install_diagnostic_witness_test.dag +++ b/dag/test/claim/srv3_os_install_diagnostic_witness_test.dag @@ -1,5 +1,66 @@ module test.claim.srv3_os_install_diagnostic - +import std.bit { Bool } +import std.types { Milliseconds } +import std.measure { byte_size } +import gunbc.srv3_os_install_diagnostic { + srv3_os_install_attempt_intent, + srv3_install_hang_no_installer_progress_ms, + srv3_install_hang_no_router_lease_ms, + diagnose_os_install_actuation, + classify_nbd_serve_readiness, + classify_router_lease_table, + install_diagnostic_verdict_is_ready_to_boot, + install_diagnostic_verdict_is_os_installed, + install_diagnostic_verdict_is_boot_override_consumed_failure, + bmc_install_debug_checklist_surface_count_is_seven, + srv3_os_install_diagnostic_runbook_is_declared, + OsInstallActuationObservations, + NbdServeProcessObservation, + NbdServePortObservation, + IsoServeReadinessObservation, + RedfishSystemBootObservation, + BmcVirtualMediaObservation, + SolConsoleContentObservation, + KvmObservation, + KvmFirmwareMenu, + KvmUnknown, + NbdkitAbsent, + ServeProcessesPresent, + ServePortListening, + ServePortAbsent, + TokenPresent, + IsoPresent, + IsoHashMismatch, + BootProgressNone, + BootProgressOsRunning, + ReadyToBootVerdict, + VirtualMediaServeDown, + BootOverrideConsumedNoInstall, + BootAttemptInProgress, + AutoinstallRunning, + InstallerHungVerdict, + OsInstalledVerdict, + OnlyBmcLeasePresent, +} +import gunbc.srv3_seeded_install_media_artifact { srv3_seeded_install_media_content_hash } +import gunbc.network_identity_subsumption { + srv3_pre_install_lease_table, + srv3_post_install_lease_table_fixture, +} +import gunbc.srv3_os_install_actuate_scope { srv3_actuator_virtual_media_iso_install_path } +import gunbc.fleet_intent_network { operator_host_srv3 } +import extdeps.bmc.webui.nbd_proxy_serve { srv3_nbd_proxy_local_port } +import extdeps.bmc.types { + RedfishBootSourceOverrideEnabled, + BootOverrideOnce, + BootTargetCd, + On, +} +import extdeps.router.verizon_cr1000a { Cr1000aDhcpLeaseTable } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_os_install_emit_test.dag b/dag/test/claim/srv3_os_install_emit_test.dag index f4a1ecc41f0..dd69c5447be 100644 --- a/dag/test/claim/srv3_os_install_emit_test.dag +++ b/dag/test/claim/srv3_os_install_emit_test.dag @@ -1,5 +1,16 @@ module test.claim.srv3_os_install_emit - +import std.bit { Bool } +import gunbc.os_install_emit { autoinstall_user_data } +import gunbc.os_install { srv3_ubuntu_autoinstall } +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, + operator_host_srv3, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_os_install_witness_test.dag b/dag/test/claim/srv3_os_install_witness_test.dag index 882afcca7e5..0fb157cdf5c 100644 --- a/dag/test/claim/srv3_os_install_witness_test.dag +++ b/dag/test/claim/srv3_os_install_witness_test.dag @@ -1,5 +1,44 @@ module test.claim.srv3_os_install - +import std.bit { Bool } +import std.os.types { + UbuntuOs, + WindowsOs, + MacosOs, + NobleNumbat2404Lts, +} +import extdeps.toolchain.types { + X86_64, + Riscv64, +} +import extdeps.provisioning.network_boot { + network_uefi_bootloader_artifact, + ProxyDhcp, + UefiHttpBoot, + UefiPxe, +} +import extdeps.os.ubuntu_autoinstall { NoCloudLocal } +import gunbc.os_install { + LanInstallInfraSurvey, + survey_implied_dhcp_direction, + srv3_pxe_network_boot_chain, + srv3_os_install_plan, + NetworkBoot, + VirtualMediaIso, + srv3_os_install_plan_autoinstall, + fleet_install_server_specs, +} +import gunbc.os_install_mechanism { + NbdProxyVirtualMediaInstall, + srv3_install_mechanism, +} +import extdeps.bmc.types { + redfish_boot_target_wire, + redfish_boot_override_enabled_wire, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_runner_memory_cap_plan_verify_witness_test.dag b/dag/test/claim/srv3_runner_memory_cap_plan_verify_witness_test.dag index b9fce2b7a33..bbbfc03025e 100644 --- a/dag/test/claim/srv3_runner_memory_cap_plan_verify_witness_test.dag +++ b/dag/test/claim/srv3_runner_memory_cap_plan_verify_witness_test.dag @@ -1,4 +1,33 @@ module test.claim.srv3_runner_memory_cap_plan_verify_witness +import v2.std.live_tree { LiveTreeDisposition } +import gunbc.host_runner_memory_cap_verify { + RunnerMemoryCapVerifyObserved, + runner_memory_cap_verify_receipt_converged, + runner_memory_cap_verify_receipt_from_read, + runner_memory_cap_verify_result_from_live_read, +} +import gunbc.runner_unit_live_read { + RunnerUnitLiveReadRow, + RunnerUnitMemoryLiveRead, + runner_unit_live_read_typed, +} +import std.measure { byte_size_count } +import gunbc.fleet_converge_cli { + converge_cli_receipt_from_memory_cap_verify, + converge_cli_receipt_line, + converge_cli_routes_to_memory_cap_verify, +} +import gunbc.host_runner_memory_cap_plan_emit { + expected_runner_memory_cap_apply_sheet, + runner_memory_cap_plan_emit_claims_nothing, +} +import gunbc.host_converge { + gunbc_runner_per_slot_dropin_path, + gunbc_runner_per_slot_high_dropin_path, + gunbc_runner_per_slot_swap_dropin_path, +} +import gunbc.runner_slot_allocation { gunbc_runner_slot_desired } +import gunbc.fleet_intent_network { operator_host_srv3 } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_runner_memory_converge_witness_test.dag b/dag/test/claim/srv3_runner_memory_converge_witness_test.dag index 581b0b31376..010a75b0666 100644 --- a/dag/test/claim/srv3_runner_memory_converge_witness_test.dag +++ b/dag/test/claim/srv3_runner_memory_converge_witness_test.dag @@ -1,4 +1,46 @@ module test.claim.srv3_runner_memory_converge_witness +import gunbc.host_converge { + ConvergeKnob, + HostConverge, + PerSlotMemoryCap, + converge_apply_mode_label, + gunbc_apply_mode_for_host, + gunbc_runner_per_slot_dropin_path, + gunbc_runner_per_slot_high_dropin_path, + legacy_converge_knob, + runner_instance_glob, +} +import v2.std.live_tree { LiveTreeDisposition } +import std.measure { + byte_size, + byte_size_count, +} +import gunbc.host_converge_slice1 { + converge_knob_by_name, + host_converge_from_policy, +} +import gunbc.runner_slot_allocation { + gunbc_committed_host_runner_slot_allocation, + gunbc_runner_slot_desired, +} +import gunbc.runner_unit_live_read { + gunbc_srv1_runner_unit_live_read_fixture, + runner_unit_live_read_typed, +} +import gunbc.host_runner_memory_provision { + host_runner_memory_provision_scope_binds_realize_frontier, + provision_runner_memory_caps_routes_through_host_effect_apply, + runner_memory_cap_readback_verdict, + runner_memory_host_converge, + runner_memory_knob_apply_interpreted, + runner_memory_knobs_from, +} +import gunbc.host_standup { host_standup_fleet_converge_policy } +import gunbc.fleet_intent_network { operator_host_srv3 } +import extdeps.systemd { + systemd_memory_high_property, + systemd_memory_max_property, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_seeded_install_media_witness_test.dag b/dag/test/claim/srv3_seeded_install_media_witness_test.dag index de79a866e77..dcbeb8cc5e8 100644 --- a/dag/test/claim/srv3_seeded_install_media_witness_test.dag +++ b/dag/test/claim/srv3_seeded_install_media_witness_test.dag @@ -1,5 +1,37 @@ module test.claim.srv3_seeded_install_media - +import gunbc.srv3_seeded_install_media_artifact { + srv3_seeded_install_media_artifact, + srv3_seeded_ubuntu_install_media_install_path, + srv3_autoinstall_user_data_body, +} +import gunbc.srv3_seeded_install_media { + srv3_seeded_install_media_actuator_host_is_srv1, + srv3_seeded_install_media_install_path_is_versioned, + srv3_seeded_autoinstall_delivery_is_on_iso, + srv3_seeded_grub_cmdline_names_nocloud, + srv3_seeded_install_media_unattended_not_proven_yet, + srv3_seeded_install_media_remaster_toolchain_is_modeled, + srv3_seeded_install_media_toolchain_ensure_is_privileged_gated, +} +import gunbc.srv3_host_effect_apply { srv3_seeded_install_media_toolchain_unprivileged_fixture_denied } +import gunbc.host_effect_realize { srv3_seeded_install_media_toolchain_receipt_line } +import extdeps.provisioning.ubuntu_seeded_install_media_remaster { + install_media_remaster_bash_emit_dissolution_trigger, + install_media_remaster_classification_scaffold, + install_media_remaster_chmod_access_upsert_scaffold, + install_media_remaster_probe_refusal_shape_doc, +} +import std.disposition { + Scaffold, + Terminal, +} +import std.types { NonEmptyStr } +import gunbc.os_install_emit { autoinstall_user_data } +import gunbc.os_install { srv3_ubuntu_autoinstall_on_iso } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/srv3_subsumption_witness_test.dag b/dag/test/claim/srv3_subsumption_witness_test.dag index 7369e2532a9..8e78a87815a 100644 --- a/dag/test/claim/srv3_subsumption_witness_test.dag +++ b/dag/test/claim/srv3_subsumption_witness_test.dag @@ -1,5 +1,57 @@ module test.claim.srv3_subsumption - +import product.placement_supply { HostIdentity } +import gunbc.host_toolchain_ensure { + HostToolchainKind, + HostToolchainReach, + ResolvedHostToolchainReach, + host_toolchain_direct_access, + host_toolchain_ensure_reach, +} +import v2.std.live_tree { LiveTreeDisposition } +import gunbc.bootstrap { Ownership } +import extdeps.ssh { SshPublicKey } +import v2.std.algebra { any } +import gunbc.host_authorized_keys_reconcile { + authorized_key_identity, + authorized_key_identity_eq, + authorized_key_ownership, + authorized_key_value_eq, + host_authorized_keys_reconcile, + srv3_observed_authorized_keys, + srv3_observed_briansrls_srv1_key, + srv3_observed_node_orch_srv2_key, + srv4_observed_authorized_keys, +} +import gunbc.ci_deploy_access { ci_deploy_srv1_operator_access } +import gunbc.fleet_ssh_access { + fleet_authorized_keys, + fleet_automation_ssh_key, + operator_macbook_ssh_key, +} +import gunbc.host_identity_access { host_identity_srv1_access } +import std.types { list_length } +import gunbc.membership_reconcile { + membership_reconcile, + membership_tally, +} +import gunbc.fleet_intent_network { + operator_host_srv1, + operator_host_srv2, + operator_host_srv3, + operator_host_srv4, +} +import extdeps.network.reach { reach_realizability } +import extdeps.network.endpoint { render_network_host } +import gunbc.fleet_reach { + srv2_lan_reach_host, + srv3_lan_reach_host, + srv3_reach, + srv3_reach_fabric_intended, + srv3_reach_is_realizable, + srv3_reach_target, +} +import gunbc.fleet_intent { srv3_host } +import gunbc.os_install_actuator_selection { srv3_os_install_actuator_host } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/stage0_emit_model_witness_test.dag b/dag/test/claim/stage0_emit_model_witness_test.dag index 21f1c533bdb..9c67f6f0596 100644 --- a/dag/test/claim/stage0_emit_model_witness_test.dag +++ b/dag/test/claim/stage0_emit_model_witness_test.dag @@ -1,4 +1,13 @@ module test.claim.stage0_emit_model_witness +import gunbc.stage0_emit_model { + stage0_module_emit_basename, + stage0_module_emit_filename, + is_generated_stage0_file, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/storage_nvme_grounding_witness_test.dag b/dag/test/claim/storage_nvme_grounding_witness_test.dag index 63f4d85a7f9..effc826f74d 100644 --- a/dag/test/claim/storage_nvme_grounding_witness_test.dag +++ b/dag/test/claim/storage_nvme_grounding_witness_test.dag @@ -1,5 +1,29 @@ module test.claim.storage_nvme_grounding - +import std.bit { Bool } +import std.measure { + byte_size_count, + bandwidth_count, +} +import extdeps.storage.types { + NvmeDeviceCatalogRow, + PcieGeneration, + pcie_link_bandwidth, + pcie_generation_per_lane_bandwidth, + nvme_storage_device, + StorageDevice, + Persistent, + Nvme, + storage_device_capacity, + storage_device_medium, + storage_device_read_bandwidth, + storage_device_pcie_link, +} +import extdeps.storage.samsung { samsung_970_evo_plus_2tb_catalog } +import extdeps.storage.western_digital { wd_black_sn850x_2tb_catalog } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/tailscale_acl_phase2_design_witness_test.dag b/dag/test/claim/tailscale_acl_phase2_design_witness_test.dag index 13559c7f09c..33ce35e6c62 100644 --- a/dag/test/claim/tailscale_acl_phase2_design_witness_test.dag +++ b/dag/test/claim/tailscale_acl_phase2_design_witness_test.dag @@ -1,4 +1,63 @@ module test.claim.tailscale_acl_phase2_design_witness +import gunbc.tailscale_acl_phase2_credential { + tailscale_acl_ephemeral_token_secret_id, + tailscale_acl_ephemeral_lifetime, + tailscale_acl_operator_adc_strategy, + tailscale_acl_gcp_secret_credential_authority, + tailscale_acl_adc_refresh_credential_authority, + tailscale_acl_optional_impersonation_authority, + tailscale_acl_operator_email, + operator_principal_member, + operator_tailscale_acl_secret_bindings, + operator_bindings_are_user_principal_accessor_only, + operator_bindings_admit_repo_scoped_wif, + operator_bindings_admit_bmc_assimilator_sa, + tailscale_acl_credential_flow_uses_auth_patterns, + tailscale_acl_phase2_credential_design_holds, + tailscale_acl_phase2_live_write_disposition, + acl_auto_upsert_refused, + acl_upsert_permitted, + acl_upsert_wet_shape_is_diff_print_only, + ephemeral_token_gate_fail_closed, + ephemeral_token_gate_valid, + tailscale_ephemeral_token_within_ttl, + DiffPending, + OperatorConfirmed, + RefusedAutoUpsert, + PoliciesDiffer, + PoliciesMatch, + DiffPrintOnly, + LiveWriteRefused, + TokenPresent, + TokenAbsent, + TokenExpired, +} +import gunbc.fleet_posix_accounts { + fleet_operator_gcp_iam_member, + fleet_operator_email, +} +import gunbc.assimilate.bmc_token_federation { + SecretAccessBinding, + bmc_secrets_project_id, + bmc_federated_github_repo, + bmc_wif_principal_set, + bmc_assimilator_sa_member, +} +import extdeps.cloud.gcp.gcp { AdcRefresh } +import extdeps.cloud.gcp.iam { role_secretmanager_secret_accessor } +import std.disposition { + Scaffold, + SingleAuthority, +} +import std.measure { + second, + second_count, +} +import std.types { Secret } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/tailscale_acl_witness_test.dag b/dag/test/claim/tailscale_acl_witness_test.dag index c9175a5083a..31f457779df 100644 --- a/dag/test/claim/tailscale_acl_witness_test.dag +++ b/dag/test/claim/tailscale_acl_witness_test.dag @@ -1,5 +1,24 @@ module test.claim.tailscale_acl_witness - +import extdeps.tailscale.acl { + operator_tailscale_acl_policy, + tag_ci, + tag_dashboard, + dashboard_cutover_mac_ip, + dashboard_cutover_mac_dissolution_trigger, + tag_ci_quarantine_holds, + tag_dashboard_admin_plane_holds, + dashboard_cutover_ip_is_transient_in_tag_ci_grant, + ssh_members_reach_ci_nonroot_only, + ssh_dashboard_reaches_ci_root_and_nonroot, + operator_acl_security_spine_holds, + tailscale_grants_external_authority_holds, +} +import gunbc.tailscale_acl_emit { expected_tailscale_acl_json } +import extdeps.filesystem.filesystem_io { Filesystem } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/temporal_effect_spine_witness_test.dag b/dag/test/claim/temporal_effect_spine_witness_test.dag index b077c6385dc..bb69a1e1b6a 100644 --- a/dag/test/claim/temporal_effect_spine_witness_test.dag +++ b/dag/test/claim/temporal_effect_spine_witness_test.dag @@ -1,5 +1,85 @@ module test.claim.temporal_effect_spine - +import std.types { + Bool, + NonEmptyStr, + List, + ContentHash, + Timestamp, + Milliseconds, +} +import std.measure { + millisecond, + millisecond_count, +} +import std.temporal_effect { + EffectAttemptIntent, + EffectStepReceipt, + AppliedEffectRef, + NoEffectApplied, + EffectApplied, + HeldLease, + LeasePortForeign, + LeaseRunningStale, + LeaseRunningExpected, + LeaseAbsent, + LeaseInaccessible, + DurableApprovalGrant, + GrantAbsent, + GrantActive, + GrantConsumed, + PriorStepReceipt, + NoPriorReceipt, + PriorReceipt, + NextStepPlan, + PlanRefuse, + PlanAwaitApproval, + PlanDrainThenStart, + PlanNoop, + PlanApply, + plan_next_step_from_prior_receipt_and_lease, + approval_grant_covers_intent, + derived_pending_step_id, + prior_receipt_for_step, + held_lease_observed_verdict, + decision_for_held_lease_verdict, + NextStepApplyPlan, + ApplyAtStep, + DrainThenStartAtStep, + EffectStallBudget, + StallWithinBudget, + StallBudgetExceeded, + stall_budget_verdict, + next_step_plan_on_stall_budget, +} +import gunbc.srv3_os_install_diagnostic { + srv3_install_hang_no_installer_progress_ms, + srv3_install_hang_no_router_lease_ms, + OsInstallHangStallCause, + HangStallWithinBudget, + HangStallInstallerProgressSilent, + HangStallRouterLeaseAbsent, + cause_fold_dominant_hang_stall, +} +import gunbc.host_standup_assimilation_deduction { + hang_budget_millisecond, + srv3_os_install_to_host_identity_budget, +} +import std.upsert_decision { + ObservationVerdict, + Converged, + Absent, + Drifted, + Conflict, + Inaccessible, + UpsertDecision, + Noop, + Apply, + Refuse, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/terminal_capability_witness_test.dag b/dag/test/claim/terminal_capability_witness_test.dag index 3490d68335a..a59c0a04716 100644 --- a/dag/test/claim/terminal_capability_witness_test.dag +++ b/dag/test/claim/terminal_capability_witness_test.dag @@ -1,4 +1,27 @@ module test.claim.terminal_capability_witness +import std.render { + Append, + CursorAction, + Overwrite, + RenderCapability, + Viewport, + Chars, + cursor_action_under, +} +import std.materialization_ladder { Frame } +import std.symbols { + Ascii, + Unicode, +} +import extdeps.render.terminal { project_frame } +import extdeps.render.terminal_capability { + TerminalEnvironment, + detect_capability, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/time_scale_factor_derivation_test.dag b/dag/test/claim/time_scale_factor_derivation_test.dag index 7505c3f418a..ebec83cf743 100644 --- a/dag/test/claim/time_scale_factor_derivation_test.dag +++ b/dag/test/claim/time_scale_factor_derivation_test.dag @@ -1,5 +1,17 @@ module test.claim.time_scale_factor_derivation - +import std.bit { Bool } +import std.nat { Nat } +import std.measure { + Scale, + One, + Sixty, + time_scale_factor_seconds, + scale_exponent, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/typescript_program_serializer_test.dag b/dag/test/claim/typescript_program_serializer_test.dag index 1b22e782212..7ad42aaac00 100644 --- a/dag/test/claim/typescript_program_serializer_test.dag +++ b/dag/test/claim/typescript_program_serializer_test.dag @@ -1,5 +1,24 @@ module test.claim.typescript_program_serializer - +import std.bit { Bool } +import extdeps.languages.typescript.program { + TsProgram, + serialize_typescript_program, + ts_ident, + ts_lit_str, + ts_lit_num, + ts_lit_regex, + ts_member, + ts_call, + ts_binop, + ts_const, + ts_expr_stmt, + ts_block, + ts_arrow, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/unicode_ident_xid_grounding_test.dag b/dag/test/claim/unicode_ident_xid_grounding_test.dag index 9f2f80a0ee0..f14b55bc97a 100644 --- a/dag/test/claim/unicode_ident_xid_grounding_test.dag +++ b/dag/test/claim/unicode_ident_xid_grounding_test.dag @@ -1,5 +1,9 @@ module test.claim.unicode_ident_xid_grounding - +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/uri_grounding_witness_test.dag b/dag/test/claim/uri_grounding_witness_test.dag index 3787cc30f56..0b68990ac8d 100644 --- a/dag/test/claim/uri_grounding_witness_test.dag +++ b/dag/test/claim/uri_grounding_witness_test.dag @@ -1,4 +1,15 @@ module test.claim.uri_grounding_witness +import extdeps.uri { + Uri, + Https, + uri_is_url, + uri_wire, +} +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/uri_path_parse_witness_test.dag b/dag/test/claim/uri_path_parse_witness_test.dag index 5358be80555..b2082f3ba7f 100644 --- a/dag/test/claim/uri_path_parse_witness_test.dag +++ b/dag/test/claim/uri_path_parse_witness_test.dag @@ -1,4 +1,21 @@ module test.claim.uri_path_parse_witness +import extdeps.uri_path { + parse_path_template, + ParsedPathTemplate, + MalformedPathTemplate, +} +import std.http_path { + PathTemplate, + UrlPathToken, + has_path_params, + last_path_param, + PathParamBinding, + render_path_template, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/uri_witness_test.dag b/dag/test/claim/uri_witness_test.dag index ffa594e7823..ba2273c6ce4 100644 --- a/dag/test/claim/uri_witness_test.dag +++ b/dag/test/claim/uri_witness_test.dag @@ -1,4 +1,17 @@ module test.claim.uri_witness +import extdeps.uri { + Uri, + Http, + Https, + File, + uri_is_url, + uri_scheme_is_http, +} +import std.bit { Bool } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/v1_dag_parse_witness_test.dag b/dag/test/claim/v1_dag_parse_witness_test.dag index 02d532f788c..a83bfe6a8fa 100644 --- a/dag/test/claim/v1_dag_parse_witness_test.dag +++ b/dag/test/claim/v1_dag_parse_witness_test.dag @@ -1,5 +1,9 @@ module test.claim.v1_dag_parse_witness - +import tools.v1_dag_parse_transport { run_v1_dag_parse } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/void_element_test.dag b/dag/test/claim/void_element_test.dag index a28446e9c1d..af4ba6ceb79 100644 --- a/dag/test/claim/void_element_test.dag +++ b/dag/test/claim/void_element_test.dag @@ -1,8 +1,13 @@ module test.claim.void_element - -import std.markup { Fragment, Element, FragmentText, attr } +import std.markup { + Element, + Fragment, + FragmentText, + attr, +} import extdeps.languages.html { serialize_html_source } import extdeps.languages.react_jsx { serialize_jsx_component } +import v2.std.live_tree { LiveTreeDisposition } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/websocat_install_source_witness_test.dag b/dag/test/claim/websocat_install_source_witness_test.dag index 10c87dd290d..a8e41e250e4 100644 --- a/dag/test/claim/websocat_install_source_witness_test.dag +++ b/dag/test/claim/websocat_install_source_witness_test.dag @@ -1,5 +1,16 @@ module test.claim.websocat_install_source - +import std.bit { Bool } +import extdeps.tools { SourceGitHubRelease } +import extdeps.tools.websocat { + websocat_cli_tool, + websocat_github_repo, + websocat_github_tag, + websocat_install_path, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/wet_hermetic_equivalence_witness_test.dag b/dag/test/claim/wet_hermetic_equivalence_witness_test.dag index f2b95f89ba6..e8d079be205 100644 --- a/dag/test/claim/wet_hermetic_equivalence_witness_test.dag +++ b/dag/test/claim/wet_hermetic_equivalence_witness_test.dag @@ -1,4 +1,8 @@ module test.claim.wet_hermetic_equivalence_witness +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/witness_row_cost_projection_witness_test.dag b/dag/test/claim/witness_row_cost_projection_witness_test.dag index fe25d061eb0..a3d42a05594 100644 --- a/dag/test/claim/witness_row_cost_projection_witness_test.dag +++ b/dag/test/claim/witness_row_cost_projection_witness_test.dag @@ -1,53 +1,59 @@ module test.claim.witness_row_cost_projection - import gunbc.witness_row_cost { + DeclarationWitness, + EntryResolveParent, + WitnessCostEventRole, WitnessCostProjectionComplete, WitnessCostProjectionRefused, WitnessCostReceiptRow, - WitnessCostEventRole, - EntryResolveParent, - DeclarationWitness, project_witness_cost_receipt, - witness_cost_event_role, - witness_cost_entry_resolve_event, witness_cost_declaration_event, - witness_cost_nested_resolve_under_declaration_event, + witness_cost_entry_resolve_event, + witness_cost_event_role, + witness_cost_event_role_note, witness_cost_module_resolve_event, + witness_cost_native_production_note, + witness_cost_nested_resolve_under_declaration_event, + witness_cost_rss_unavailable_cause, witness_cost_seed_done_event, - witness_cost_seed_refused_event, witness_cost_seed_failed_event, + witness_cost_seed_refused_event, witness_cost_seed_timed_out_event, witness_cost_warm, - witness_cost_rss_unavailable_cause, - witness_cost_native_production_note, - witness_cost_event_role_note, } import std.logic { Bool } import std.nat { Nat } -import std.types { NonEmptyStr, List, Int } +import std.types { + Int, + List, + NonEmptyStr, +} import std.measure { Nanosecond, - nanosecond, - nanosecond_count, millisecond, + millisecond_count, millisecond_to_nanosecond, + nanosecond, + nanosecond_count, nanosecond_to_millisecond_floor, - millisecond_count, } -import std.decl_ref { DeclarationRef, WholeDeclaration } +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} import std.observation { - ObservationEvent, + Ambient, + AttentionBasis, + Begin, + Done, + Failed, + Final, MeasuredUnavailable, MeasuredValue, - Done, + ObservationEvent, Refused, - Failed, - TimedOut, Skipped, - Final, - Begin, - AttentionBasis, - Ambient, + TimedOut, observation_attention, } import gunbc.observation_ci_render { diff --git a/dag/test/claim/workflow_recursive_gate.dag b/dag/test/claim/workflow_recursive_gate.dag index 5c9b204c985..7dc2356b72b 100644 --- a/dag/test/claim/workflow_recursive_gate.dag +++ b/dag/test/claim/workflow_recursive_gate.dag @@ -1,5 +1,14 @@ module test.claim.workflow_recursive_gate - +import std.process { + ProcessExit, + ExitSuccess, + ExitFailure, +} +import extdeps.process.posix_exit { exit_code_general_error } +import test.claim.workflow_recursive_witness { + workflow_kernel_witnessed, + workflow_kernel_all_verified, +} func main() -> ProcessExit { let w = workflow_kernel_witnessed() diff --git a/dag/test/claim/workflow_recursive_witness_test.dag b/dag/test/claim/workflow_recursive_witness_test.dag index 899d221fa86..6e6cae1ec78 100644 --- a/dag/test/claim/workflow_recursive_witness_test.dag +++ b/dag/test/claim/workflow_recursive_witness_test.dag @@ -1,4 +1,43 @@ module test.claim.workflow_recursive_witness +import std.bit { Bool } +import std.types { + NonEmptyStr, + List, +} +import std.reducible { + ReduceVerdict, + Reduced, + Irreducible, + Unknown, + reduce_verdict_combine, + verdict_eq, +} +import std.workflow_recursive { + VerdictTree, + Leaf, + Decomposed, + settle_verdict_tree, + linearize_verdicts, +} +import gunbc.idea_pr_spine { + StageStep, + IdeaInput, + DagModel, + Review, + review_step, + settle, + demo_spine_green, + demo_spine_unknown, +} +import gunbc.review_verdict { + Llm, + Claude, + RequestChanges, +} +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/yaml_ingest_witness_test.dag b/dag/test/claim/yaml_ingest_witness_test.dag index 9ea7a22fa79..7bcca075f94 100644 --- a/dag/test/claim/yaml_ingest_witness_test.dag +++ b/dag/test/claim/yaml_ingest_witness_test.dag @@ -1,4 +1,25 @@ module test.claim.yaml_ingest_witness +import extdeps.languages.yaml.types { + YamlValue, + yaml_string, + yaml_int, + yaml_bool, + yaml_mapping, + yaml_sequence, + kv, +} +import extdeps.languages.yaml.emit { serialize_yaml } +import extdeps.languages.yaml.ingest { + ingest_yaml_source, + yaml_source_parses, + IngestedYaml, + YamlIngestRejected, +} +import gunbc.ci_yaml_emit { expected_ci_yml } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/yaml_multiline_block_witness_test.dag b/dag/test/claim/yaml_multiline_block_witness_test.dag index 4fb1f8f8913..9f283e72f1a 100644 --- a/dag/test/claim/yaml_multiline_block_witness_test.dag +++ b/dag/test/claim/yaml_multiline_block_witness_test.dag @@ -1,4 +1,16 @@ module test.claim.yaml_multiline_block_witness +import extdeps.languages.yaml.types { + YamlValue, + yaml_string, + yaml_mapping, + yaml_sequence, + kv, +} +import extdeps.languages.yaml.emit { serialize_yaml } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/claim/yaml_quoting_witness_test.dag b/dag/test/claim/yaml_quoting_witness_test.dag index e67f51dc019..8f3683f4831 100644 --- a/dag/test/claim/yaml_quoting_witness_test.dag +++ b/dag/test/claim/yaml_quoting_witness_test.dag @@ -1,4 +1,15 @@ module test.claim.yaml_quoting_witness +import extdeps.languages.yaml.types { + YamlValue, + yaml_string, + yaml_mapping, + kv, +} +import extdeps.languages.yaml.emit { serialize_yaml } +import v2.std.live_tree { + LiveTreeDisposition, + SubstrateInputsOnly, +} data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/dag/test/fixture/m4_universal_governed_corpus.dag b/dag/test/fixture/m4_universal_governed_corpus.dag index 5441dddabb7..0bda233a755 100644 --- a/dag/test/fixture/m4_universal_governed_corpus.dag +++ b/dag/test/fixture/m4_universal_governed_corpus.dag @@ -1,5 +1,5 @@ module test.fixture.m4_universal_governed_corpus - +import std.hermetic_replay { PublishedMockCase } data m4_universal_probe_case_allowed: PublishedMockCase = PublishedMockCase { operation_key: "GovernedUniversalProbe.Allowed", diff --git a/dag/test/retirement/e0308_mechanical_trio_retained.dag b/dag/test/retirement/e0308_mechanical_trio_retained.dag index c1d6804309d..2b125916baa 100644 --- a/dag/test/retirement/e0308_mechanical_trio_retained.dag +++ b/dag/test/retirement/e0308_mechanical_trio_retained.dag @@ -1,5 +1,8 @@ module test.retirement.e0308_mechanical_trio_retained - +import test.retirement.model { + RetainedNonMigratable, + TestModuleRetirement, +} data e0308_mechanical_trio_retention: TestModuleRetirement = TestModuleRetirement { module: "e0308_mechanical_trio_test.rs", diff --git a/dag/test/retirement/field_of_fractions_construction_retained.dag b/dag/test/retirement/field_of_fractions_construction_retained.dag index cefa7fed43e..540583a2140 100644 --- a/dag/test/retirement/field_of_fractions_construction_retained.dag +++ b/dag/test/retirement/field_of_fractions_construction_retained.dag @@ -1,5 +1,8 @@ module test.retirement.field_of_fractions_construction_retained - +import test.retirement.model { + RetainedNonMigratable, + TestModuleRetirement, +} data field_of_fractions_construction_retention: TestModuleRetirement = TestModuleRetirement { module: "field_of_fractions_construction_test.rs", diff --git a/dag/test/retirement/field_of_fractions_single_declaration_retained.dag b/dag/test/retirement/field_of_fractions_single_declaration_retained.dag index a4870ca99a5..6a368edf0fe 100644 --- a/dag/test/retirement/field_of_fractions_single_declaration_retained.dag +++ b/dag/test/retirement/field_of_fractions_single_declaration_retained.dag @@ -1,5 +1,8 @@ module test.retirement.field_of_fractions_single_declaration_retained - +import test.retirement.model { + RetainedNonMigratable, + TestModuleRetirement, +} data field_of_fractions_single_declaration_retention: TestModuleRetirement = TestModuleRetirement { module: "field_of_fractions_single_declaration_test.rs", diff --git a/dag/test/retirement/group_completion_construction_retained.dag b/dag/test/retirement/group_completion_construction_retained.dag index 36dac3b31d9..36eff59ef8c 100644 --- a/dag/test/retirement/group_completion_construction_retained.dag +++ b/dag/test/retirement/group_completion_construction_retained.dag @@ -1,5 +1,8 @@ module test.retirement.group_completion_construction_retained - +import test.retirement.model { + RetainedNonMigratable, + TestModuleRetirement, +} data group_completion_construction_retention: TestModuleRetirement = TestModuleRetirement { module: "group_completion_construction_test.rs", diff --git a/dag/test/retirement/map_lookup_dual_dispatch_retired.dag b/dag/test/retirement/map_lookup_dual_dispatch_retired.dag index 5caa4a64ecb..608716e11c9 100644 --- a/dag/test/retirement/map_lookup_dual_dispatch_retired.dag +++ b/dag/test/retirement/map_lookup_dual_dispatch_retired.dag @@ -1,5 +1,8 @@ module test.retirement.map_lookup_dual_dispatch_retired - +import test.retirement.model { + TestModuleRetirement, + DeleteLowValue, +} data map_lookup_dual_dispatch_retirement: TestModuleRetirement = TestModuleRetirement { module: "map_lookup_dual_dispatch_test.rs", diff --git a/dag/test/retirement/materialization_provider_resolved_graph_consumer_retained.dag b/dag/test/retirement/materialization_provider_resolved_graph_consumer_retained.dag index 0ce0449b2a6..a7a67aabe4f 100644 --- a/dag/test/retirement/materialization_provider_resolved_graph_consumer_retained.dag +++ b/dag/test/retirement/materialization_provider_resolved_graph_consumer_retained.dag @@ -1,5 +1,8 @@ module test.retirement.materialization_provider_resolved_graph_consumer_retained - +import test.retirement.model { + RetainedNonMigratable, + TestModuleRetirement, +} data materialization_provider_resolved_graph_consumer_retention: TestModuleRetirement = TestModuleRetirement { module: "materialization_provider_resolved_graph_consumer_test.rs", diff --git a/dag/test/retirement/namespace_unique_on_chain_policy_retained.dag b/dag/test/retirement/namespace_unique_on_chain_policy_retained.dag index 28174601cd7..d76f0f4b10d 100644 --- a/dag/test/retirement/namespace_unique_on_chain_policy_retained.dag +++ b/dag/test/retirement/namespace_unique_on_chain_policy_retained.dag @@ -1,9 +1,12 @@ module test.retirement.namespace_unique_on_chain_policy_retained - +import test.retirement.model { + RetainedNonMigratable, + TestModuleRetirement, +} data namespace_unique_on_chain_policy_retention: TestModuleRetirement = TestModuleRetirement { module: "namespace_unique_on_chain_policy_test.rs", disposition: RetainedNonMigratable { - reason: "The namespace-resolution-design.md section-13 keystone witness toggles the host thread-local NameResolutionPolicy gate (v1_rt.name_resolution_policy_set_namespace_only) between ImportScoped and NamespaceOnlyY, then compiles homonym fixtures and asserts the strict policy refuses with AmbiguousReference where the default resolves. That thread-local process-state toggle is host-Rust-only and is unreachable from a dag witness (a substrate program has no handle to flip the seed interpreter's resolution policy), so this module cannot migrate to an exact-stem test dag floor witness. It is therefore RETAINED as rs, not migration debt and not a delete candidate. This retention dissolves when src/v1 is deleted at v2 self-host, at which point the policy gate and its host toggle cease to exist." + reason: "The namespace-resolution-design.md section-13 / namespace-canonical-binding keystone witness toggles the host thread-local NameResolutionPolicy gate (v1_rt.name_resolution_policy_set_namespace_only) between ImportScoped and NamespaceOnlyY, then compiles homonym / zero-on-chain / off-chain fixtures and asserts BOTH toggle values refuse through the one module_path_owner_binding_decide fold — AmbiguousReference for on-chain homonyms, UnresolvedType for zero-on-chain (never widened to Ambiguous), and no nearest-wins / first-hit bypass when the obsolete host gate is false (policy_bracket_does_not_bypass_canonical_homonym_refusal). The gate is no longer a behavioral split; the retained rs proves the obsolete host toggle cannot bypass canonical binding. That thread-local process-state toggle is host-Rust-only and is unreachable from a dag witness (a substrate program has no handle to flip the seed interpreter's resolution policy), so this module cannot migrate to an exact-stem test dag floor witness. It is therefore RETAINED as rs, not migration debt and not a delete candidate. Hand-Rust receipt: gunbc.namespace_unique_on_chain_policy_scaffold is the ONE LOC census authority (checkable anchor gunbc.roadmap_authority namespace-canonical-binding; dissolve-on after→0), witnessed by dag/test/claim/namespace_unique_on_chain_policy_hand_rust_witness_test.dag. NO NUMBERS ARE REPEATED HERE, DELIBERATELY (review 45420): this row used to embed its own copy of the before/after/net census, and when the real receipt moved the copy stayed behind and became false without anyone touching this file -- a section 3 parallel representation of a fact the scaffold owns. Aligning the two copies would only reset the clock on the same drift, which is the same reason the scaffold itself stopped carrying absolute cli_run LOC (review 45409). Read the numbers from the scaffold rows; discriminating tests include zero_on_chain_containment_census_matches_inference_unresolved (inference/containment census parity). This retention dissolves when src/v1 is deleted at v2 self-host, at which point the policy gate and its host toggle cease to exist." } } diff --git a/dag/test/retirement/none_undetermined_carrier_refuse_retained.dag b/dag/test/retirement/none_undetermined_carrier_refuse_retained.dag index 721f1070a0a..f9d4e993e58 100644 --- a/dag/test/retirement/none_undetermined_carrier_refuse_retained.dag +++ b/dag/test/retirement/none_undetermined_carrier_refuse_retained.dag @@ -1,5 +1,8 @@ module test.retirement.none_undetermined_carrier_refuse_retained - +import test.retirement.model { + RetainedNonMigratable, + TestModuleRetirement, +} data none_undetermined_carrier_refuse_retention: TestModuleRetirement = TestModuleRetirement { module: "none_undetermined_carrier_refuse_test.rs", diff --git a/dag/test/retirement/pipeline_self_gen8_retired.dag b/dag/test/retirement/pipeline_self_gen8_retired.dag index 54658918597..e4be5e06d84 100644 --- a/dag/test/retirement/pipeline_self_gen8_retired.dag +++ b/dag/test/retirement/pipeline_self_gen8_retired.dag @@ -1,5 +1,9 @@ module test.retirement.pipeline_self_gen8_retired - +import test.retirement.model { + TestModuleRetirement, + DeleteRedundant, + DeleteLowValue, +} data pipeline_self_gen8_green_retirement: TestModuleRetirement = TestModuleRetirement { module: "pipeline.rs self_gen8 cluster, 22 green fns of 31 (the file survives, so this row is a triage receipt, not a delete-guard stem: pipeline.rs itself still needs its own coverage when the file is finally deleted)", diff --git a/src/v1/00_core.dag b/src/v1/00_core.dag index 5a22104ec86..d3aac16c395 100644 --- a/src/v1/00_core.dag +++ b/src/v1/00_core.dag @@ -19,6 +19,7 @@ import std.occurrence_identity { DuplicateAuthoredOccurrenceIdentity, InconsistentOccurrenceContainment, WrongOccurrenceCategory, + UnknownOccurrenceIdentity, } type Token { @@ -180,25 +181,28 @@ type ErrorDAG { errors: List } +data occurrence_transport_refusal_span_absence_note: String = "Span absence for OccurrenceTransportRefusal is decided HERE, by a total wildcard-free match, and rendered by diagnostic_to_span as no_span() -- the corpus's single authority for 'no authored location' (review 45364).\n\nWHY THERE IS NO SPAN TO CARRY: UnknownOccurrenceIdentity is raised when an OccurrenceId is in neither entries_by_id nor references_by_id (std.occurrence_binding_resolve resolve_reference_occurrence_binding_validated). resolve_reference_occurrence_binding takes ONLY an OccurrenceId (review 45106) precisely so caller-supplied span facts cannot bypass the validated carrier, so at that point no authored span exists to report. This is absence by construction, not a failure to compute one.\n\nWHAT WAS DELETED AND WHY: this arm previously minted two placeholder SourceSpans -- file '' and a wildcard ''. Both are removed. The wildcard was the DESIGN section 5 absorbing arm: a future spanless variant would have been absorbed into an anonymous placeholder instead of stopping the line. It is now unreachable-by-construction rather than merely unused, because adding a variant reds the total match below AND the total match in occurrence_transport_refusal_diagnostic_message. The '' file name was additionally a section 2 duplicate: the occurrence id is already carried by occurrence_transport_refusal_diagnostic_message, so the span restated a fact the message owns, and a bespoke pseudo-file was a section 3 nickname for no_span().\n\nBOUND, STATED HONESTLY: diagnostic_to_span returns SourceSpan, not SourceSpan?, so span-absence is rendered rather than typed at that boundary. Making it typed changes a load-bearing v1 seed signature with 3 dag and 24 Rust call sites and is a separate corpus-wide change, not this node's scope. Until then no_span() is the honest rendering and the message carries the identity." + fn occurrence_transport_refusal_diagnostic_span( refusal: OccurrenceTransportRefusal -) -> SourceSpan { +) -> SourceSpan? { match refusal { - MissingAuthoredOccurrenceIdentity { diagnostic_span: span } => span + MissingAuthoredOccurrenceIdentity { diagnostic_span: span } => Present { value: span } DuplicateAuthoredOccurrenceIdentity { occurrence: _, diagnostic_span: span, - } => span + } => Present { value: span } InconsistentOccurrenceContainment { occurrence: _, diagnostic_span: span, - } => span + } => Present { value: span } WrongOccurrenceCategory { occurrence: _, expected: _, observed: _, diagnostic_span: span, - } => span + } => Present { value: span } + UnknownOccurrenceIdentity { occurrence: _ } => Absent } } @@ -231,6 +235,11 @@ fn occurrence_transport_refusal_diagnostic_message( "occurrence transport refused: wrong category for authored occurrence identity ", to_string(value: occurrence.value) ) + UnknownOccurrenceIdentity { occurrence: occurrence } => + concat( + "occurrence transport refused: unknown occurrence identity ", + to_string(value: occurrence.value) + ) } } @@ -258,7 +267,10 @@ fn diagnostic_to_span(d: CompilerDiagnostic) -> SourceSpan { UnlistedImportUse { name: _, span: s } => s AmbiguousReference { name: _, candidates: _, span: s } => s OccurrenceTransportViolation { refusal: refusal } => - occurrence_transport_refusal_diagnostic_span(refusal: refusal) + match occurrence_transport_refusal_diagnostic_span(refusal: refusal) { + Present { value: span } => span + Absent => no_span() + } } } diff --git a/src/v1/04_env.dag b/src/v1/04_env.dag index e86e6c27524..e4b83a598ec 100644 --- a/src/v1/04_env.dag +++ b/src/v1/04_env.dag @@ -7,6 +7,14 @@ import std.types { SourceSpan, is_kernel_type } import std.induction { InductiveField, RecursionShape, DirectRecursion, ListRecursion, OptionalRecursion, SetRecursion, MapValueRecursion, SubValueRelation, SubValueUnknown, PreservedValue } import std.algebra { FreeMonoid, Empty, Cons } +import v1.compiler.infer_occurrence_binding { + module_path_owner_binding_decide, + ModulePathBindingAmbiguous, + ModulePathBindingHit, + ModulePathBindingMiss, + ambiguity_labels_from_decide, +} + type TypeEnv { bindings: Map @@ -29,7 +37,7 @@ type TypeBinding { provenance: SubValueRelation } -data global_bare_fallback_invariant: String = "Corpus-wide bare-name census, resolved by ONE uniform containment walk (operator ruling 2026-07-18: global uniqueness is NOT a special tier — it is the shallowest level of the same walk; filepaths are irrelevant, the declared module path is the containment tree). SymbolIndex.global_bare is keyed on the bare declared name and built once by build_symbol_index_census over graph.modules before any module typechecks (order-independent). Tracking is decl-only via symbol_index_insert_decl / local_binding_for_item (type/fn/data names) plus corpus-globally-unique Disj variant aliases (unique across the WHOLE bare-name space: a variant whose name any type/fn/data decl claims stays qualified-only, never a global_bare candidate — else a type-vs-variant tie, e.g. actions.Job vs ExpressionContext.Job, refuses every far use of the TYPE); every homonym keeps its FULL candidate list (module_path + binding), never a candidate-free Ambiguous tombstone. Resolution (global_bare_lookup): a single candidate resolves from anywhere (the one-candidate degenerate case of the walk); multiple candidates resolve by nearest-ancestor containment — the candidate whose module path shares the strictly longest leading-segment prefix with the REFERENCING module (TypeEnv.module_path) wins; any tie at the max, including the all-disjoint lcp=0 case, REFUSES (Absent — fail-closed, never guesses, §5; the source must qualify by containment path). lookup_binding_by_name consults it only after str_bindings/ancestry_str_bindings/intern+bindings all miss. Variant arms additionally merge into per-module variant_locals via merge_global_bare_variant_locals (constructor_binding_authority — owner is the coproduct node)." +data global_bare_fallback_invariant: String = "Corpus-wide bare-name census (operator ruling 2026-07-18: filepaths are irrelevant — the declared module path is the containment tree). SymbolIndex.global_bare is keyed on the bare declared name and built once by build_symbol_index_census over graph.modules before any module typechecks (order-independent). Tracking is decl-only via symbol_index_insert_decl / local_binding_for_item (type/fn/data names) plus corpus-globally-unique Disj variant aliases (unique across the WHOLE bare-name space: a variant whose name any type/fn/data decl claims stays qualified-only, never a global_bare candidate — else a type-vs-variant tie, e.g. actions.Job vs ExpressionContext.Job, refuses every far use of the TYPE); every homonym keeps its FULL candidate list (module_path + binding), never a candidate-free Ambiguous tombstone. Resolution (global_bare_lookup / unique_on_chain_policy_note — ONE authority, review 45102): candidates are filtered to the referencing module's containment chain (declaring module path is a leading-segment prefix of TypeEnv.module_path, or equal); cardinality then routes through module_path_owner_binding_decide (0 → Unresolved/Absent, 1 → bind, 2+ → Ambiguous). A corpus-unique name off-chain does NOT resolve from anywhere — zero on-chain never authorizes whole-corpus search. Nearest-ancestor / first-hit selection is retired on these production surfaces (global_bare_nearest_ancestor* remains only for silent-pick recording of the old LCP heuristic, not for binding). lookup_binding_by_name consults global_bare only after str_bindings/ancestry_str_bindings/intern+bindings all miss. Variant arms additionally merge into per-module variant_locals via merge_global_bare_variant_locals (constructor_binding_authority — owner is the coproduct node)." data qualified_module_projection_invariant: String = "Grammar lane G1/G1b: container.member module projection in value/type/pattern and fn/data/let type-annotation positions resolves via symbol_index_lookup on the full qualified path (module projection), not value field-access — v2 resolve: TypeNode Conj QN spines; v1 typecheck: lookup_binding_by_name after global_bare; v1 patterns: lookup_variant_in_type routes dotted variant names through symbol_index_lookup. build_symbol_index_census materializes declared-module item paths plus module-unique Disj variant aliases (qualified path always; corpus-unique variants also enter global_bare — mirrors v2 symbol_index_fill_unique_variant_aliases); lookup_qualified_module_projection runs only when the reference carries a dot (fail-closed on miss — never widens to field-access semantics)." @@ -553,7 +561,7 @@ fn global_bare_nearest_ancestor(env_module_path: String, candidates: List) -> List { let env_segs = module_path_segments(path: env_module_path) @@ -565,33 +573,26 @@ fn global_bare_chain_candidates(env_module_path: String, candidates: List) -> GlobalBareCandidate? { let chain = global_bare_chain_candidates(env_module_path: env_module_path, candidates: candidates) - match (chain |> count) == 1 { - true => chain |> first - false => Absent + match module_path_owner_binding_decide(owners: chain |> map(c => c.module_path)) { + ModulePathBindingHit { owner: owner } => + chain |> filter(c => c.module_path == owner) |> first + ModulePathBindingMiss => Absent + ModulePathBindingAmbiguous { owners: _ } => Absent } } fn global_bare_policy_candidate(env_module_path: String, candidates: List) -> GlobalBareCandidate? { - if name_resolution_policy_is_namespace_only() { - global_bare_unique_chain_candidate(env_module_path: env_module_path, candidates: candidates) - } else { - global_bare_nearest_ancestor_candidate(env_module_path: env_module_path, candidates: candidates) - } + global_bare_unique_chain_candidate(env_module_path: env_module_path, candidates: candidates) } fn global_bare_strict_ambiguity_candidates(env: TypeEnv, name: String) -> List { - if name_resolution_policy_is_namespace_only() == false { - return [] - } match map_get(env.symbol_index.global_bare, name) { Present { value: GlobalBareAmbiguousBinding { candidates: cands } } => let chain = global_bare_chain_candidates(env_module_path: env.module_path, candidates: cands) - if (chain |> count) == 1 { - [] - } else { - let pool = if (chain |> count) >= 2 { chain } else { cands } - pool |> map(c => concat(c.module_path, ".", name)) - } + ambiguity_labels_from_decide( + owners: chain |> map(c => c.module_path), + name: name, + ) _ => [] } } @@ -608,9 +609,16 @@ fn bare_name_miss_diagnostic(env: TypeEnv, name: String, span: SourceSpan) -> Co fn global_bare_owner_module(env: TypeEnv, owner_module_path: String, name: String) -> String? { match map_get(env.symbol_index.global_bare, name) { Present { value: GlobalBareUniqueBinding { module_path: mp, binding: b } } => - match binding_declares_name(binding: b, name: name, source_indices: env.source_indices) { - true => Present { value: mp } - false => Absent + match global_bare_unique_chain_candidate( + env_module_path: owner_module_path, + candidates: [GlobalBareCandidate { module_path: mp, binding: b }], + ) { + Present { value: cand } => + match binding_declares_name(binding: cand.binding, name: name, source_indices: env.source_indices) { + true => Present { value: cand.module_path } + false => Absent + } + Absent => Absent } Present { value: GlobalBareAmbiguousBinding { candidates: cands } } => match global_bare_policy_candidate(env_module_path: owner_module_path, candidates: cands) { @@ -758,20 +766,19 @@ fn record_global_bare_ambiguous_silent_pick( fn global_bare_lookup(env: TypeEnv, name: String) -> TypeBinding? { match map_get(env.symbol_index.global_bare, name) { - Present { value: GlobalBareUniqueBinding { module_path: _, binding: binding } } => Present { value: binding } - Present { value: GlobalBareAmbiguousBinding { candidates: cands } } => { - if name_resolution_policy_is_namespace_only() { - match global_bare_unique_chain_candidate(env_module_path: env.module_path, candidates: cands) { - Present { value: cand } => Present { value: cand.binding } - Absent => Absent - } - } else { - if resolution_silent_pick_is_enabled() && (cands |> count) >= 2 { - record_global_bare_ambiguous_silent_pick(env_module_path: env.module_path, name: name, cands: cands) - } - global_bare_nearest_ancestor(env_module_path: env.module_path, candidates: cands) + Present { value: GlobalBareUniqueBinding { module_path: mp, binding: binding } } => + match global_bare_unique_chain_candidate( + env_module_path: env.module_path, + candidates: [GlobalBareCandidate { module_path: mp, binding: binding }], + ) { + Present { value: cand } => Present { value: cand.binding } + Absent => Absent + } + Present { value: GlobalBareAmbiguousBinding { candidates: cands } } => + match global_bare_unique_chain_candidate(env_module_path: env.module_path, candidates: cands) { + Present { value: cand } => Present { value: cand.binding } + Absent => Absent } - } Absent => Absent } } @@ -779,10 +786,11 @@ fn global_bare_lookup(env: TypeEnv, name: String) -> TypeBinding? { fn global_bare_is_ambiguous(env: TypeEnv, name: String) -> Bool { match map_get(env.symbol_index.global_bare, name) { Present { value: GlobalBareAmbiguousBinding { candidates: cands } } => - if name_resolution_policy_is_namespace_only() { - global_bare_unique_chain_candidate(env_module_path: env.module_path, candidates: cands) == none - } else { - global_bare_nearest_ancestor(env_module_path: env.module_path, candidates: cands) == none + let chain = global_bare_chain_candidates(env_module_path: env.module_path, candidates: cands) + match module_path_owner_binding_decide(owners: chain |> map(c => c.module_path)) { + ModulePathBindingAmbiguous { owners: _ } => true + ModulePathBindingHit { owner: _ } => false + ModulePathBindingMiss => false } Present { value: GlobalBareUniqueBinding { module_path: _, binding: _ } } => false Absent => false diff --git a/src/v1/04_lookup.dag b/src/v1/04_lookup.dag index e693f0ecacc..d6def28f2fa 100644 --- a/src/v1/04_lookup.dag +++ b/src/v1/04_lookup.dag @@ -38,7 +38,10 @@ import v1.compiler.infer_types { import v1.compiler.infer_env { TypeEnv, TypeBinding, authored_name, is_recursive_type, lookup_type, lookup_type_for, - GlobalBareLookupState, borrowed_generic_param_names, global_bare_policy_candidate, lookup_binding_by_name, lookup_binding_by_name_local, qualified_all_but_last, qualify_borrowed_type_names, symbol_index_lookup + GlobalBareCandidate, GlobalBareLookupState, borrowed_generic_param_names, + global_bare_policy_candidate, global_bare_unique_chain_candidate, + lookup_binding_by_name, lookup_binding_by_name_local, qualified_all_but_last, + qualify_borrowed_type_names, symbol_index_lookup } import v1.compiler.infer_emit_info { @@ -112,7 +115,14 @@ fn borrowed_census_decl(type_env: TypeEnv, name: String) -> BorrowedCensusDecl? } else { match map_get(type_env.symbol_index.global_bare, name) { Present { value: GlobalBareUniqueBinding { module_path: mp, binding: b } } => - Present { value: BorrowedCensusDecl { owner_module_path: mp, node: b.resolved } } + match global_bare_unique_chain_candidate( + env_module_path: type_env.module_path, + candidates: [GlobalBareCandidate { module_path: mp, binding: b }], + ) { + Present { value: cand } => + Present { value: BorrowedCensusDecl { owner_module_path: cand.module_path, node: cand.binding.resolved } } + Absent => none + } Present { value: GlobalBareAmbiguousBinding { candidates: cands } } => match global_bare_policy_candidate(env_module_path: type_env.module_path, candidates: cands) { Present { value: cand } => diff --git a/src/v1/04_occurrence_binding.dag b/src/v1/04_occurrence_binding.dag new file mode 100644 index 00000000000..f5c3a5c8f7d --- /dev/null +++ b/src/v1/04_occurrence_binding.dag @@ -0,0 +1,40 @@ +module v1.compiler.infer_occurrence_binding + +import std.types { String } + +data infer_occurrence_binding_canonical_decide_note: String = "v1 production adapter: global_bare chain and func parent-closure cardinality fold through module_path_owner_binding_decide, which mirrors occurrence_binding_from_candidates 0/1/many semantics on owner module paths without importing generic std.occurrence_binding into stage0 (generic emission lacks Clone/serde bounds). Candidate enumeration stays in infer_env/infer_sigs. Scaffold receipt: gunbc.infer_occurrence_binding_scaffold (binds std.occurrence_binding_resolve.module_path_binding_decide; witness: dag/test/claim/infer_occurrence_binding_scaffold_witness_test.dag). DISSOLVE-ON: stage0 emits std.occurrence_binding_resolve and this adapter delegates to module_path_binding_decide by execution." + +type ModulePathBindingProjection + = ModulePathBindingHit { owner: String } + | ModulePathBindingMiss + | ModulePathBindingAmbiguous { owners: List } + +fn module_path_owner_binding_decide( + owners: List +) -> ModulePathBindingProjection { + let owner_count = owners |> count + if owner_count == 0 { + ModulePathBindingMiss + } else if owner_count == 1 { + match owners |> first { + Present { value: owner } => ModulePathBindingHit { owner: owner } + Absent => ModulePathBindingMiss + } + } else { + ModulePathBindingAmbiguous { owners: owners } + } +} + +data ambiguity_labels_single_authority_note: String = "ONE labeller for both production candidate sites (review 45364). global_bare_chain_ambiguity_labels_from_decide and func_parent_closure_ambiguity_labels_from_decide were token-identical modulo a local bind name -- a section 3 nickname pair, two names for one concept, which the predicate-dissolution pass left resident. The call site is not part of the fact: qualifying an ambiguous owner list is the same operation whether the candidates came from the global_bare chain (04_env) or a fn parent closure (04_sigs), so the site-prefixed names encoded a distinction that does not exist. Collapsed to ambiguity_labels_from_decide, consumed by both.\n\nWILDCARD-FREE (review 45417): the collapsed fn inherited a _ => [] arm from the two it replaced. ModulePathBindingProjection is a closed 3-arm type, so a wildcard means a future variant silently yields no labels -- an ambiguity that reports as unambiguous, which is the DESIGN section 5 absorbing shape and the same arm this PR deleted from v1.std.core diagnostic_to_span. Hit and Miss are now spelled out, so adding a variant is a compile error here rather than a silent empty label list." + +fn ambiguity_labels_from_decide( + owners: List, + name: String +) -> List { + match module_path_owner_binding_decide(owners: owners) { + ModulePathBindingAmbiguous { owners: ambiguous_owners } => + ambiguous_owners |> map(owner => concat(owner, ".", name)) + ModulePathBindingHit { owner: _ } => [] + ModulePathBindingMiss => [] + } +} diff --git a/src/v1/04_sigs.dag b/src/v1/04_sigs.dag index 0f27c971cf5..65703755cb9 100644 --- a/src/v1/04_sigs.dag +++ b/src/v1/04_sigs.dag @@ -12,6 +12,12 @@ import v1.std.core { import v1.compiler.infer_types { emit_map_has } +import v1.compiler.infer_occurrence_binding { + ambiguity_labels_from_decide, + module_path_owner_binding_decide, + ModulePathBindingProjection, +} + import std.induction { SubValueRelation } @@ -67,7 +73,7 @@ type ParentSigScan { first_parent: String? } -data func_sig_lookup_outcome_note: String = "namespace-resolution-design.md 13 / 8 step 1, fn path: ResolvedFuncSig? overloaded Absent as 'keep looking' (the census fallback fires on it), so a refusal had nowhere to go — the first-hit over func_env.parents was the fn silent-pick class (fn_parent_first_hit) with NO refusal arm at all. FuncSigLookup is the 3-state outcome: FuncSigResolved binds, FuncSigUnresolved means genuinely-no-sig (census fallback may still run), FuncSigAmbiguous carries the full candidate list and REFUSES — it never falls through to a fallback. Under ImportScoped (host bracket false) the Ambiguous arm is unreachable (first-hit preserved verbatim); under the default NamespaceOnlyY policy exactly-one match across the flat parent closure resolves, two-plus refuses. Own-module local hit stays first on both arms: the killed class is the pick among >=2 PARENT matches (the census's fn_parent_first_hit definition), not own-decl precedence. Analysis-only consumers (provenance/descent enrichment) project through func_sig_if_resolved in infer_lookup — they never fabricate a bind; the semantic bind sites in 04_infer match the full outcome and emit the typed AmbiguousReference." +data func_sig_lookup_outcome_note: String = "namespace-resolution-design.md 13 / 8 step 1, fn path: ResolvedFuncSig? overloaded Absent as 'keep looking' (the census fallback fires on it), so a refusal had nowhere to go — the first-hit over func_env.parents was the fn silent-pick class (fn_parent_first_hit) with NO refusal arm at all. FuncSigLookup is the 3-state outcome: FuncSigResolved binds, FuncSigUnresolved means genuinely-no-sig (census fallback may still run), FuncSigAmbiguous carries the full candidate list and REFUSES — it never falls through to a fallback. lookup_resolved_sig always routes parent misses through lookup_resolved_sig_unique_across_parents (module_path_owner_binding_decide): exactly-one owner across the parent closure resolves, zero is Unresolved, two-plus is Ambiguous — the ImportScoped first-hit branch is deleted, and the policy bracket must not restore it. Own-module local hit stays first: the killed class is the pick among >=2 PARENT matches (the census's fn_parent_first_hit definition), not own-decl precedence. Analysis-only consumers (provenance/descent enrichment) project through func_sig_if_resolved in infer_lookup — they never fabricate a bind; the semantic bind sites in 04_infer match the full outcome and emit the typed AmbiguousReference." type FuncSigLookup = FuncSigResolved { sig: ResolvedFuncSig } @@ -90,16 +96,20 @@ fn lookup_resolved_sig_unique_across_parents(env: ResolvedFuncEnv, name: String) Absent => acc } ) - let owner_count = scan.owners |> count - if owner_count == 0 { - FuncSigUnresolved - } else if owner_count == 1 { - match scan.first_sig { - Present { value: sig } => FuncSigResolved { sig: sig } - Absent => FuncSigUnresolved - } - } else { - FuncSigAmbiguous { candidates: scan.owners |> map(o => concat(o, ".", name)) } + match module_path_owner_binding_decide(owners: scan.owners) { + ModulePathBindingMiss => FuncSigUnresolved + ModulePathBindingHit { owner: _ } => + match scan.first_sig { + Present { value: sig } => FuncSigResolved { sig: sig } + Absent => FuncSigUnresolved + } + ModulePathBindingAmbiguous { owners: _ } => + FuncSigAmbiguous { + candidates: ambiguity_labels_from_decide( + owners: scan.owners, + name: name, + ), + } } } @@ -133,25 +143,7 @@ fn lookup_resolved_sig_with_telemetry(env: ResolvedFuncEnv, name: String) -> Res fn lookup_resolved_sig(env: ResolvedFuncEnv, name: String) -> FuncSigLookup { match map_get(env.local, name) { Present { value: sig } => FuncSigResolved { sig: sig } - Absent => - if name_resolution_policy_is_namespace_only() { - lookup_resolved_sig_unique_across_parents(env: env, name: name) - } else { - let first_hit = if resolution_silent_pick_is_enabled() { - lookup_resolved_sig_with_telemetry(env: env, name: name) - } else { - fold(env.parents, init: none_resolved_sig(), f: (acc, p) => - match acc { - Present { value: sig } => Present { value: sig } - Absent => map_get(p.local, name) - } - ) - } - match first_hit { - Present { value: sig } => FuncSigResolved { sig: sig } - Absent => FuncSigUnresolved - } - } + Absent => lookup_resolved_sig_unique_across_parents(env: env, name: name) } } diff --git a/src/v1/stage0/src/cli_run.rs b/src/v1/stage0/src/cli_run.rs index 2dadc8c02ab..d9bb5b52017 100644 --- a/src/v1/stage0/src/cli_run.rs +++ b/src/v1/stage0/src/cli_run.rs @@ -15,13 +15,17 @@ use crate::std_types::{kernel_type_set, SourceSpan}; use crate::v1_compiler_compile; use crate::v1_compiler_infer; use crate::v1_compiler_infer_env::{ - lookup_binding_by_name, lookup_type_by_name, qualified_all_but_last, symbol_index_insert, - symbol_index_lookup, GlobalBareLookupState, SymbolIndex, TypeEnv, + global_bare_chain_candidates, global_bare_unique_chain_candidate, lookup_binding_by_name, + lookup_type_by_name, qualified_all_but_last, symbol_index_insert, symbol_index_lookup, + GlobalBareLookupState, SymbolIndex, TypeEnv, }; use crate::v1_compiler_infer_items::{item_kind, ItemInfo, ItemKind, ResolvedGraph, TypedModule}; use crate::v1_compiler_infer_lookup::func_sig_if_resolved; use crate::v1_compiler_infer_lookup::global_bare_callable_node; use crate::v1_compiler_infer_method::infer_builtin_call_type; +use crate::v1_compiler_infer_occurrence_binding::{ + module_path_owner_binding_decide, ModulePathBindingProjection, +}; use crate::v1_compiler_infer_sigs::{lookup_resolved_sig, ResolvedFuncEnv, ResolvedFuncSig}; use crate::v1_compiler_normalize; use crate::v1_compiler_parse; @@ -5725,18 +5729,31 @@ fn bare_reference_pull_paths_for_source( } match v1_rt::map_get(&census.global_bare, name.clone()) { Some(state) => match state.as_ref() { + // Same chain+decide authority as inference / containment_resolve + // (unique_on_chain_policy_note): zero on-chain never authorizes + // whole-corpus search, including nearest-ancestor LCP widen. GlobalBareLookupState::GlobalBareUniqueBinding { module_path, binding, - } => { - if pullable(binding) { - Some(module_path.clone()) + } => global_bare_unique_chain_candidate( + referencing_module.clone(), + Rc::new( + vec![Rc::new(crate::v1_compiler_infer_env::GlobalBareCandidate { + module_path: module_path.clone(), + binding: binding.clone(), + })] + .into(), + ), + ) + .and_then(|c| { + if pullable(&c.binding) { + Some(c.module_path.clone()) } else { None } - } + }), GlobalBareLookupState::GlobalBareAmbiguousBinding { candidates } => { - crate::v1_compiler_infer_env::global_bare_nearest_ancestor_candidate( + global_bare_unique_chain_candidate( referencing_module.clone(), candidates.clone(), ) @@ -14978,8 +14995,8 @@ fn floor_filename_hygiene_refusal_via_producer(source_roots: &[String]) -> Resul return Ok(()); } let (graph, indices) = - resolve_entry_graph_shared(source_roots, &floor_discovery_producer_entry_anchored()) - .map_err(|e| format!("floor_discovery_producer resolve for filename hygiene: {e}"))?; + resolve_entry_graph_shared(source_roots, &floor_naming_hygiene_entry_anchored()) + .map_err(|e| format!("floor_naming_hygiene resolve for filename hygiene: {e}"))?; let ctx = make_eval_context(&graph, indices, v1_interpreter::ExecutionMode::Wet); let path_values: Vec = dag_paths .iter() @@ -15024,6 +15041,7 @@ fn floor_filename_hygiene_refusal_via_producer(source_roots: &[String]) -> Resul } const FLOOR_DISCOVERY_PRODUCER_ENTRY: &str = "src/v2/workflow/floor_discovery_producer.dag"; +const FLOOR_NAMING_HYGIENE_ENTRY: &str = "src/v2/workflow/floor_naming_hygiene.dag"; /// The producer entry above is repo-relative, and every resolve of it ultimately reads the /// path **cwd-relative** (`entry_source_from_index_or_disk` does a bare `Path::is_file`). @@ -15047,6 +15065,11 @@ fn floor_discovery_producer_entry_anchored() -> String { anchored.to_string_lossy().into_owned() } +fn floor_naming_hygiene_entry_anchored() -> String { + let anchored = process_workspace_root().join(FLOOR_NAMING_HYGIENE_ENTRY); + anchored.to_string_lossy().into_owned() +} + fn owned_data_decl_record_to_value( rec: &OwnedDataDeclRecord, ctx: &v1_interpreter::InterpContext, @@ -25093,19 +25116,79 @@ pub fn containment_resolve_fn_v1_for_module( module_path: owner, binding, }) => { - if is_fn_like_binding(&binding.resolved, owner, name, item_index) { - return ContainmentResolve::Hit { - owner_module: owner.clone(), - qualified_path: module_path_to_qualified_path(&owner, name), - node_ptr: Rc::as_ptr(&binding.resolved) as usize, - via: ContainmentResolveVia::GlobalUnique, - lexical_steps: 0, - }; - } - ContainmentResolve::Unresolved + return match global_bare_unique_chain_candidate( + module_path.to_string(), + Rc::new( + vec![Rc::new(crate::v1_compiler_infer_env::GlobalBareCandidate { + module_path: owner.clone(), + binding: binding.clone(), + })] + .into(), + ), + ) { + Some(cand) => { + if is_fn_like_binding( + &cand.binding.resolved, + &cand.module_path, + name, + item_index, + ) { + ContainmentResolve::Hit { + owner_module: cand.module_path.clone(), + qualified_path: module_path_to_qualified_path(&cand.module_path, name), + node_ptr: Rc::as_ptr(&cand.binding.resolved) as usize, + via: ContainmentResolveVia::GlobalUnique, + lexical_steps: 0, + } + } else { + ContainmentResolve::Unresolved + } + } + None => ContainmentResolve::Unresolved, + }; } - Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { .. }) => { - ContainmentResolve::Ambiguous + Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { candidates }) => { + let chain = crate::v1_compiler_infer_env::global_bare_chain_candidates( + module_path.to_string(), + candidates.clone(), + ); + let owners: Rc> = + Rc::new(chain.iter().map(|cand| cand.module_path.clone()).collect()); + match (*module_path_owner_binding_decide(owners)).clone() { + ModulePathBindingProjection::ModulePathBindingMiss => { + ContainmentResolve::Unresolved + } + ModulePathBindingProjection::ModulePathBindingHit { .. } => { + if let Some(cand) = + crate::v1_compiler_infer_env::global_bare_unique_chain_candidate( + module_path.to_string(), + candidates.clone(), + ) + { + if is_fn_like_binding( + &cand.binding.resolved, + &cand.module_path, + name, + item_index, + ) { + return ContainmentResolve::Hit { + owner_module: cand.module_path.clone(), + qualified_path: module_path_to_qualified_path( + &cand.module_path, + name, + ), + node_ptr: Rc::as_ptr(&cand.binding.resolved) as usize, + via: ContainmentResolveVia::GlobalUnique, + lexical_steps: 0, + }; + } + } + ContainmentResolve::Unresolved + } + ModulePathBindingProjection::ModulePathBindingAmbiguous { .. } => { + ContainmentResolve::Ambiguous + } + } } None => ContainmentResolve::Unresolved, } diff --git a/src/v1/stage0/src/cli_run/test_module_hygiene_bridge.rs b/src/v1/stage0/src/cli_run/test_module_hygiene_bridge.rs index 2a3f0444ae2..aa2db9bd145 100644 --- a/src/v1/stage0/src/cli_run/test_module_hygiene_bridge.rs +++ b/src/v1/stage0/src/cli_run/test_module_hygiene_bridge.rs @@ -1,4 +1,4 @@ -use crate::module_path_index::parsed_dag_file::parse_dag_file; +use crate::module_path_index::parsed_dag_file::parse_dag_file_or_err; use crate::v1_compiler_infer_items::{item_kind, ItemKind}; use crate::v1_interpreter::{self, sorted_fields, ExecutionMode, InterpContext, Value}; use crate::v1_std_core::{authored_name_at, expr_call_func_at, expr_var_name_at, ExprData, Node}; @@ -101,10 +101,12 @@ fn test_decl_names_from_content(content: &str) -> Result, String> { .collect() } -fn analyze_to_surface(path: &Path, content: &str, entry: &str) -> Option { - let parsed = parse_dag_file(path)?; +fn analyze_to_surface(path: &Path, content: &str, entry: &str) -> Result { + // Three formerly-collapsed None arms must stay distinct (DESIGN §5): parse + // refused, test-decl enumerate refused, or (via parse_dag_file_or_err) no module. + let parsed = parse_dag_file_or_err(path)?; let test_names: HashSet = test_decl_names_from_content(content) - .ok()? + .map_err(|e| format!("enumerate test decls for {entry}: {e}"))? .into_iter() .collect(); let si = parsed.source_indices.clone(); @@ -150,7 +152,7 @@ fn analyze_to_surface(path: &Path, content: &str, entry: &str) -> Option {} } } - Some(ModuleSurface { + Ok(ModuleSurface { entry: entry.to_string(), test_fns, plain_fns, @@ -283,11 +285,10 @@ fn collect_module_surfaces(roots: &[String]) -> Result, Strin continue; } }; - let Some(surface) = analyze_to_surface(&path, &content, &rel) else { - failures.push(format!("parse failed: {rel}")); - continue; - }; - surfaces.push(surface); + match analyze_to_surface(&path, &content, &rel) { + Ok(surface) => surfaces.push(surface), + Err(cause) => failures.push(format!("{rel}: {cause}")), + } } if !failures.is_empty() { return Err(format!( @@ -449,7 +450,7 @@ pub(crate) fn module_surface_for_test( content: &str, entry: &str, ) -> Option { - analyze_to_surface(path, content, entry) + analyze_to_surface(path, content, entry).ok() } pub(crate) fn invoke_orphan_plain_names( @@ -535,9 +536,8 @@ mod test_module_hygiene_bridge_equivalence_tests { let path = Path::new(entry); let content = std::fs::read_to_string(path) .map_err(|e| format!("orphan check read {entry}: {e}"))?; - let Some(surface) = analyze_to_surface(path, &content, entry) else { - return Err(format!("orphan check: parse failed for {entry}")); - }; + let surface = analyze_to_surface(path, &content, entry) + .map_err(|cause| format!("orphan check: {entry}: {cause}"))?; surfaces.push(surface); } let roots = super::super::default_source_roots(); @@ -653,7 +653,7 @@ fn formerly_test_holds() -> Bool { let err = check_orphan_helpers_or_err(&[root]).expect_err("unparsable *_test.dag must refuse"); assert!( - err.contains("parse failed") || err.contains("garbage_unparsable_test.dag"), + err.contains("parse error") || err.contains("garbage_unparsable_test.dag"), "must locate the parse failure: {err}" ); let _ = std::fs::remove_dir_all(&dir); diff --git a/src/v1/stage0/src/lib.rs b/src/v1/stage0/src/lib.rs index 27aafc8f707..8f129213606 100644 --- a/src/v1/stage0/src/lib.rs +++ b/src/v1/stage0/src/lib.rs @@ -105,6 +105,7 @@ pub mod v1_compiler_infer_env; pub mod v1_compiler_infer_items; pub mod v1_compiler_infer_lookup; pub mod v1_compiler_infer_method; +pub mod v1_compiler_infer_occurrence_binding; pub mod v1_compiler_infer_patterns; pub mod v1_compiler_infer_resolve; pub mod v1_compiler_infer_service; diff --git a/src/v1/stage0/src/module_path_index/parsed_dag_file.rs b/src/v1/stage0/src/module_path_index/parsed_dag_file.rs index cdf4a3a29e3..6815dfb6c69 100644 --- a/src/v1/stage0/src/module_path_index/parsed_dag_file.rs +++ b/src/v1/stage0/src/module_path_index/parsed_dag_file.rs @@ -4,7 +4,7 @@ use std::rc::Rc; use crate::v1_compiler_parse::parse; use crate::v1_compiler_tokenize::tokenize; -use crate::v1_std_core::{build_newline_index, NewlineIndex, Node}; +use crate::v1_std_core::{build_newline_index, diagnostic_to_message, NewlineIndex, Node}; type SourceIndices = Rc>>; @@ -15,8 +15,12 @@ pub struct ParsedDagFile { pub source_indices: SourceIndices, } -pub fn parse_dag_file(path: &Path) -> Option { - let content = std::fs::read_to_string(path).ok()?; +/// Parse a `.dag` file, surfacing the concrete failure cause (read / parse-error / +/// no-module). Callers that need a located refusal must use this — collapsing the +/// three states into `Option::None` is a DESIGN §5 state-space conflation. +pub fn parse_dag_file_or_err(path: &Path) -> Result { + let display = path.display(); + let content = std::fs::read_to_string(path).map_err(|e| format!("read {display}: {e}"))?; let filename = path.file_name().and_then(|s| s.to_str()).unwrap_or("?"); let tokens = tokenize(content.clone(), filename.to_string()); let source_index = build_newline_index(filename.to_string(), content); @@ -24,16 +28,26 @@ pub fn parse_dag_file(path: &Path) -> Option { indices.insert(filename.to_string(), source_index); let source_indices: SourceIndices = Rc::new(indices); let result = parse(tokens, source_indices.clone()); - if result.error.is_some() { - return None; + if let Some(err) = &result.error { + return Err(format!( + "parse error in {display}: {}", + diagnostic_to_message(err.diagnostic.clone()) + )); } - let module = result.module.as_ref()?; - Some(ParsedDagFile { + let module = result + .module + .as_ref() + .ok_or_else(|| format!("parse produced no module for {display}"))?; + Ok(ParsedDagFile { items: module.children.clone(), source_indices, }) } +pub fn parse_dag_file(path: &Path) -> Option { + parse_dag_file_or_err(path).ok() +} + pub fn parse_file(path: &Path) -> Option<(Rc>>, SourceIndices)> { parse_dag_file(path).map(|parsed| (parsed.items, parsed.source_indices)) } diff --git a/src/v1/stage0/src/std_occurrence_identity.rs b/src/v1/stage0/src/std_occurrence_identity.rs index 5a5a5cf540f..4bf66c01edd 100644 --- a/src/v1/stage0/src/std_occurrence_identity.rs +++ b/src/v1/stage0/src/std_occurrence_identity.rs @@ -3,8 +3,11 @@ use self::NodeOccurrenceIdentity::*; use self::OccurrenceCategory::*; +use self::OccurrenceCategoryBindingVerdict::*; use self::OccurrenceTransportRefusal::*; +use self::OccurrenceTransportValidation::*; pub use crate::std_algebra::FreeMonoid; +pub use crate::std_types::is_prefix_of; use crate::std_types::Bool::*; pub use crate::std_types::{Bool, SourceSpan}; use crate::v1_rt; @@ -95,6 +98,140 @@ pub enum OccurrenceCategory { MethodOccurrence, } +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(tag = "_variant")] +pub enum OccurrenceCategoryBindingVerdict { + OccurrenceCategoryBindingAdmissible, + OccurrenceCategoryBindingInadmissible { + reference: OccurrenceCategory, + declaration: OccurrenceCategory, + }, +} +impl OccurrenceCategoryBindingVerdict { + pub fn reference(&self) -> OccurrenceCategory { + match self { + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible => { + panic!("no reference on unit variant") + } + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: __val, + .. + } => __val.clone(), + } + } + pub fn declaration(&self) -> OccurrenceCategory { + match self { + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible => { + panic!("no declaration on unit variant") + } + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + declaration: __val, + .. + } => __val.clone(), + } + } +} + +pub fn occurrence_category_binding_verdict_note() -> String { + thread_local! { + static CACHED: String = { + "Canonical reference×declaration category compatibility surface (review 44773 predicate-dissolution): consumers match OccurrenceCategoryBindingVerdict directly — not a parallel Bool predicate over the OccurrenceCategory coproduct.".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +pub fn occurrence_category_binding_verdict( + reference: OccurrenceCategory, + declaration: OccurrenceCategory, +) -> Rc { + match reference.clone() { + OccurrenceCategory::TypeOccurrence => match declaration.clone() { + OccurrenceCategory::TypeOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + _ => Rc::new( + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: reference.clone(), + declaration: declaration.clone(), + }, + ), + }, + OccurrenceCategory::LexicalValueOccurrence => match declaration.clone() { + OccurrenceCategory::LexicalValueOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + OccurrenceCategory::CallableOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + OccurrenceCategory::ConstructorOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + _ => Rc::new( + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: reference.clone(), + declaration: declaration.clone(), + }, + ), + }, + OccurrenceCategory::CallableOccurrence => match declaration.clone() { + OccurrenceCategory::CallableOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + _ => Rc::new( + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: reference.clone(), + declaration: declaration.clone(), + }, + ), + }, + OccurrenceCategory::ConstructorOccurrence => match declaration.clone() { + OccurrenceCategory::ConstructorOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + _ => Rc::new( + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: reference.clone(), + declaration: declaration.clone(), + }, + ), + }, + OccurrenceCategory::FieldOccurrence => match declaration.clone() { + OccurrenceCategory::FieldOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + _ => Rc::new( + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: reference.clone(), + declaration: declaration.clone(), + }, + ), + }, + OccurrenceCategory::MethodOccurrence => match declaration.clone() { + OccurrenceCategory::MethodOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + _ => Rc::new( + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: reference.clone(), + declaration: declaration.clone(), + }, + ), + }, + OccurrenceCategory::NamespaceSegmentOccurrence => match declaration.clone() { + OccurrenceCategory::NamespaceSegmentOccurrence => { + Rc::new(OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingAdmissible) + } + _ => Rc::new( + OccurrenceCategoryBindingVerdict::OccurrenceCategoryBindingInadmissible { + reference: reference.clone(), + declaration: declaration.clone(), + }, + ), + }, + } +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] pub struct OccurrenceProjection { pub occurrence: OccurrenceId, @@ -174,28 +311,9 @@ pub enum OccurrenceTransportRefusal { observed: OccurrenceCategory, diagnostic_span: Rc, }, -} -impl OccurrenceTransportRefusal { - pub fn diagnostic_span(&self) -> Rc { - match self { - OccurrenceTransportRefusal::MissingAuthoredOccurrenceIdentity { - diagnostic_span: __val, - .. - } => __val.clone(), - OccurrenceTransportRefusal::DuplicateAuthoredOccurrenceIdentity { - diagnostic_span: __val, - .. - } => __val.clone(), - OccurrenceTransportRefusal::InconsistentOccurrenceContainment { - diagnostic_span: __val, - .. - } => __val.clone(), - OccurrenceTransportRefusal::WrongOccurrenceCategory { - diagnostic_span: __val, - .. - } => __val.clone(), - } - } + UnknownOccurrenceIdentity { + occurrence: OccurrenceId, + }, } pub fn occurrence_identity_constructor_spelling_note() -> String { @@ -304,6 +422,32 @@ pub fn occurrence_containment_paths_equal( && (left.terminal.clone().value.clone() == right.terminal.clone().value.clone())) } +pub fn occurrence_containment_path_query_note() -> String { + thread_local! { + static CACHED: String = { + "Canonical containment-path query (review 44814): occurrence_containment_path_is_prefix_of is the ONE surface for prefix tests over OccurrenceContainmentPath. It flattens ancestors++terminal and consumes std.types.is_prefix_of (review 45014 / review 45081) — never ancestor-membership alone (that admitted [A]→X as a prefix of [B,X]→Y).\n\nDELETED, NOT MOVED: occurrence_containment_path_contains_ancestor was the sibling ancestor-membership surface this row used to name. The review 45014 / 45081 correction is exactly what orphaned it — once prefix stopped consulting ancestor membership alone, nothing called it, and a corpus-wide check (dag, src/v2, src/v1) found zero consumers: its own declaration, this note, and its own generated emission. Deleting it completes that correction rather than leaving a dead second surface beside the one authority (review 45409, DESIGN section 5 dead-scaffold wall).\n\nWHY DELETED RATHER THAN ROUTED THROUGH A CANONICAL any: the review proposed folding it onto v2.std.algebra's any. That would be a section 3 inversion -- any exists ONLY in src/v2/std/algebra.dag, module v2.std.algebra, which is the v2 compiler's private copy of std; dag/std/algebra.dag, the std authority, has no any. Making std.occurrence_identity import v2.std.algebra would point the authority at a copy of itself. With zero consumers there is no surface to preserve, so deletion is both the smaller change and the correct one; if an ancestor-membership query is ever needed again it should arrive with its consumer, and any should be lifted into std.algebra first.".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +pub fn occurrence_containment_path_id_sequence( + path: Rc, +) -> Rc> { + v1_rt::rc_list_push(path.ancestors.clone(), path.terminal.clone()) +} + +pub fn occurrence_containment_path_is_prefix_of( + prefix: Rc, + path: Rc, +) -> bool { + is_prefix_of( + occurrence_containment_path_id_sequence(prefix.clone()), + occurrence_containment_path_id_sequence(path.clone()), + occurrence_id_eq, + ) +} + #[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] pub struct OccurrenceTransportIndexBuild { pub entries_by_id: Rc>>, @@ -318,10 +462,7 @@ pub fn occurrence_transport_index_build( entries_by_id: v1_rt::rc_empty_map::>(), refusal: None, }), - |build: Rc, entry: Rc| match build - .refusal - .clone() - { + |build: _, entry: _| match build.refusal.clone() { Some(_) => build.clone(), None => match v1_rt::map_get( &build.entries_by_id.clone(), @@ -388,8 +529,7 @@ pub fn occurrence_transport_role_index_build( references_by_id: v1_rt::rc_empty_map::>(), refusal: None, }), - |build: Rc, - declaration: Rc| match build.refusal.clone() { + |build: _, declaration: _| match build.refusal.clone() { Some(_) => build.clone(), None => match v1_rt::map_get( &build.declarations_by_id.clone(), @@ -421,8 +561,7 @@ pub fn occurrence_transport_role_index_build( Some(_) => declaration_build, None => references.clone().iter().cloned().fold( declaration_build, - |build: Rc, - reference: Rc| match build.refusal.clone() { + |build: _, reference: _| match build.refusal.clone() { Some(_) => build.clone(), None => match v1_rt::map_get( &build.references_by_id.clone(), @@ -538,27 +677,59 @@ pub fn reference_occurrence_refusal( } } -pub fn occurrence_transport_refusal( +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +pub struct ValidatedOccurrenceTransport { + pub entries_by_id: Rc>>, + pub references_by_id: Rc>>, + pub declarations: Rc>>, + pub references: Rc>>, +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(tag = "_variant")] +pub enum OccurrenceTransportValidation { + OccurrenceTransportValidated { + transport: Rc, + }, + OccurrenceTransportRefused { + refusal: Rc, + }, +} + +pub fn occurrence_transport_validation_authority_note() -> String { + thread_local! { + static CACHED: String = { + "Canonical transport validity boundary (review 45043): occurrence_transport_validate builds each graph-local identity/category index exactly once and either refuses or yields ValidatedOccurrenceTransport whose entries_by_id and references_by_id are the indexed authorities. Resolvers consume the validated carrier — never rescan OccurrenceIndex.entries, and never rescan the declarations/references lists, per authored occurrence. occurrence_transport_refusal is the Option projection of the same validation. references_by_id is carried rather than rebuilt (review 45329): validation already builds it to decide declaration refusals, so dropping it from the carrier forced reference lookup to re-derive the same index by a linear filter over references — a second representation of a fact this boundary already owns, and the exact rescan the sentence above forbids. The declarations/references lists remain on the carrier because refusal folds consume them in order; they are not a lookup path.".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +pub fn occurrence_transport_validate( transport: Rc, -) -> Option> { +) -> Rc { { let index_build = occurrence_transport_index_build(transport.index.clone()); match index_build.refusal.clone() { - Some(refusal) => Some(refusal.clone()), + Some(refusal) => Rc::new(OccurrenceTransportValidation::OccurrenceTransportRefused { + refusal: refusal.clone(), + }), None => { let role_index_build = occurrence_transport_role_index_build( transport.declarations.clone(), transport.references.clone(), ); match role_index_build.refusal.clone() { - Some(refusal) => Some(refusal.clone()), + Some(refusal) => { + Rc::new(OccurrenceTransportValidation::OccurrenceTransportRefused { + refusal: refusal.clone(), + }) + } None => { let declaration_refusal = transport.declarations.clone().iter().cloned().fold( None, - |refusal: _, declaration: Rc| match refusal - .clone() - { + |refusal: _, declaration: _| match refusal.clone() { Some(_) => refusal.clone(), None => declaration_occurrence_refusal( index_build.entries_by_id.clone(), @@ -568,20 +739,38 @@ pub fn occurrence_transport_refusal( }, ); match declaration_refusal.clone() { - Some(refusal) => Some(refusal.clone()), - None => transport.references.clone().iter().cloned().fold( - None, - |refusal: _, reference: Rc| match refusal - .clone() - { - Some(_) => refusal.clone(), - None => reference_occurrence_refusal( - index_build.entries_by_id.clone(), - role_index_build.declarations_by_id.clone(), - reference.clone(), - ), - }, - ), + Some(refusal) => { + Rc::new(OccurrenceTransportValidation::OccurrenceTransportRefused { + refusal: refusal.clone(), + }) + } + None => { + let reference_refusal = + transport.references.clone().iter().cloned().fold( + None, + |refusal: _, reference: _| match refusal.clone() { + Some(_) => refusal.clone(), + None => reference_occurrence_refusal( + index_build.entries_by_id.clone(), + role_index_build.declarations_by_id.clone(), + reference.clone(), + ), + }, + ); + match reference_refusal.clone() { + Some(refusal) => Rc::new(OccurrenceTransportValidation::OccurrenceTransportRefused { + refusal: refusal.clone(), +}), + None => Rc::new(OccurrenceTransportValidation::OccurrenceTransportValidated { + transport: Rc::new(ValidatedOccurrenceTransport { + entries_by_id: index_build.entries_by_id.clone(), + references_by_id: role_index_build.references_by_id.clone(), + declarations: transport.declarations.clone(), + references: transport.references.clone(), +}), +}), +} + } } } } @@ -590,6 +779,17 @@ pub fn occurrence_transport_refusal( } } +pub fn occurrence_transport_refusal( + transport: Rc, +) -> Option> { + match (*occurrence_transport_validate(transport.clone())).clone() { + OccurrenceTransportValidation::OccurrenceTransportRefused { + refusal: refusal, .. + } => Some(refusal.clone()), + OccurrenceTransportValidation::OccurrenceTransportValidated { transport: _, .. } => None, + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] pub struct LexicalValueOccurrence; #[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)] diff --git a/src/v1/stage0/src/std_types.rs b/src/v1/stage0/src/std_types.rs index 859289d9014..4f0b912a04c 100644 --- a/src/v1/stage0/src/std_types.rs +++ b/src/v1/stage0/src/std_types.rs @@ -223,6 +223,51 @@ pub type Set = Rc>; pub type Map = Rc>; +pub fn free_monoid_prefix_query_note() -> String { + thread_local! { + static CACHED: String = { + "Canonical FreeMonoid/List prefix query (DESIGN §2/§3): is_prefix_of is the single prefix walker over List (= FreeMonoid). Domain surfaces consume this — they do not re-walk Empty|Cons. Parameterized as List so stage0 Clone bounds fire via container_type_arity; FreeMonoid itself stays out of that map (enrolling it treated String=FreeMonoid as a container and broke Edge/String inference).".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +pub fn is_prefix_of( + prefix: Rc>, + xs: Rc>, + eq: impl Fn(T, T) -> bool + Clone, +) -> bool { + stacker::maybe_grow(512 * 1024, 2 * 1024 * 1024, || { + match prefix.clone().first().cloned() { + None => true, + Some(h_prefix) => match xs.clone().first().cloned() { + None => false, + Some(h_xs) => { + (eq(h_prefix.clone(), h_xs.clone()) + && is_prefix_of( + Rc::new( + prefix + .clone() + .iter() + .cloned() + .skip(1 as usize) + .collect::>(), + ), + Rc::new( + xs.clone() + .iter() + .cloned() + .skip(1 as usize) + .collect::>(), + ), + eq.clone(), + )) + } + }, + } + }) +} + pub fn list_length(items: Rc>) -> i64 { items.clone().iter().fold(0, |acc: i64, _: _| (acc + 1)) } diff --git a/src/v1/stage0/src/v1_compiler_compile.rs b/src/v1/stage0/src/v1_compiler_compile.rs index 57486cdc5ec..a1b932bfb8d 100644 --- a/src/v1/stage0/src/v1_compiler_compile.rs +++ b/src/v1/stage0/src/v1_compiler_compile.rs @@ -603,7 +603,7 @@ pub fn build_dag_key_to_id(order: Rc>>) -> Rc) -> Rc>> { typed.modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, m: Rc| { + |acc: Rc>>, m: _| { v1_rt::rc_map_merge(acc, m.type_env.clone().source_indices.clone()) }, ) @@ -2292,13 +2292,14 @@ pub fn emit_from_artifact_plan( } pub fn collect_diagnostics(parse_results: Rc>>) -> Rc>> { - parse_results.clone().iter().cloned().fold( - Rc::new(vec![]), - |acc: Rc>>, pr: Rc| match pr.error.clone() { + parse_results + .clone() + .iter() + .cloned() + .fold(Rc::new(vec![]), |acc: _, pr: _| match pr.error.clone() { Some(diag) => v1_rt::rc_list_push(acc.clone(), diag.clone()), None => acc.clone(), - }, - ) + }) } pub fn resolve_frontend_occurrence_transport( @@ -2346,10 +2347,13 @@ pub fn front_end_sources(sources: Rc>>) -> Rc } __result }); - let intern_table = prepared.clone().iter().cloned().fold( - empty_intern_table(), - |t: Rc, p: Rc| pre_intern_tokens(p.tokens.clone(), t), - ); + let intern_table = prepared + .clone() + .iter() + .cloned() + .fold(empty_intern_table(), |t: Rc, p: _| { + pre_intern_tokens(p.tokens.clone(), t) + }); let parsed = prepared.clone().iter().cloned().fold( Rc::new(FrontendAccum { parse_results: Rc::new(vec![]), @@ -2358,7 +2362,7 @@ pub fn front_end_sources(sources: Rc>>) -> Rc intern_table: intern_table.clone(), occurrence_allocator: occurrence_id_allocator_initial(), }), - |acc: Rc, p: Rc| { + |acc: _, p: _| { let parsed = parse_with_table_in_occurrence_scope( p.tokens.clone(), v1_rt::rc_map_insert( @@ -2458,10 +2462,13 @@ pub fn parse_census_fill_sources(sources: Rc>>) -> Rc, p: Rc| pre_intern_tokens(p.tokens.clone(), t), - ); + let intern_table = prepared + .clone() + .iter() + .cloned() + .fold(empty_intern_table(), |t: Rc, p: _| { + pre_intern_tokens(p.tokens.clone(), t) + }); let parsed = prepared.clone().iter().cloned().fold( Rc::new(FrontendAccum { parse_results: Rc::new(vec![]), @@ -2470,7 +2477,7 @@ pub fn parse_census_fill_sources(sources: Rc>>) -> Rc, p: Rc| { + |acc: _, p: _| { let parsed = parse_with_table_in_occurrence_scope( p.tokens.clone(), v1_rt::rc_map_insert( diff --git a/src/v1/stage0/src/v1_compiler_complexity.rs b/src/v1/stage0/src/v1_compiler_complexity.rs index 0fc61bd54ae..be92db2c48e 100644 --- a/src/v1/stage0/src/v1_compiler_complexity.rs +++ b/src/v1/stage0/src/v1_compiler_complexity.rs @@ -649,12 +649,13 @@ pub fn parser_state_expr_progress( __result }); match arm_progresses.clone().first().cloned() { - Some(initial) => arm_progresses.clone().iter().cloned().fold( - initial.clone(), - |acc: DescentEvidence, p: DescentEvidence| { + Some(initial) => arm_progresses + .clone() + .iter() + .cloned() + .fold(initial.clone(), |acc: _, p: _| { descent_evidence_lattice_meet(acc, p.clone()) - }, - ), + }), None => DescentEvidence::DescentUnknown, } } @@ -690,26 +691,28 @@ pub fn parser_block_state_progress( .take(((stmts.clone().len() as i64) - 1) as usize) .collect::>(), ); - let final_env = leading.clone().iter().cloned().fold( - env.clone(), - |acc_env: Rc, stmt: Rc| match (*stmt.expr_data.clone()) + let final_env = + leading .clone() - { - ExprData::ExprLet => match let_body(stmt.clone()) { - None => parser_env_with_binding( - let_binding_name_at(stmt.clone(), si.clone()), - let_value(stmt.clone()), - acc_env.clone(), - state_param.clone(), - parser_always_advancing.clone(), - consumed_true_set.clone(), - si.clone(), - ), - Some(_) => acc_env.clone(), - }, - _ => acc_env.clone(), - }, - ); + .iter() + .cloned() + .fold(env.clone(), |acc_env: _, stmt: Rc| { + match (*stmt.expr_data.clone()).clone() { + ExprData::ExprLet => match let_body(stmt.clone()) { + None => parser_env_with_binding( + let_binding_name_at(stmt.clone(), si.clone()), + let_value(stmt.clone()), + acc_env.clone(), + state_param.clone(), + parser_always_advancing.clone(), + consumed_true_set.clone(), + si.clone(), + ), + Some(_) => acc_env.clone(), + }, + _ => acc_env.clone(), + } + }); parser_state_expr_progress( last_stmt.clone(), state_param.clone(), @@ -890,7 +893,7 @@ pub fn collect_parser_progress_block_edges( edges: Rc::new(vec![]), env: env.clone(), }), - |acc: Rc, stmt: Rc| match (*stmt.expr_data.clone()).clone() { + |acc: _, stmt: Rc| match (*stmt.expr_data.clone()).clone() { ExprData::ExprLet => match let_body(stmt.clone()) { None => { let value_expr = let_value(stmt.clone()); @@ -1332,9 +1335,7 @@ pub fn parser_success_progress( edges: Rc::new(vec![]), env: env.clone(), }), - |acc: Rc, stmt: Rc| match (*stmt.expr_data.clone()) - .clone() - { + |acc: _, stmt: Rc| match (*stmt.expr_data.clone()).clone() { ExprData::ExprLet => match let_body(stmt.clone()) { None => { let next_env = parser_env_with_binding( @@ -4849,7 +4850,7 @@ pub fn collect_evidence_incremental( evidence: None, vars: vars.clone(), }), - |acc: Rc, stmt: Rc| { + |acc: _, stmt: Rc| { let stmt_ev = collect_evidence_incremental( stmt.clone(), func_name.clone(), @@ -6447,7 +6448,7 @@ pub fn collect_scc_child_edges( edges: Rc::new(vec![]), vars: descent_vars.clone(), }), - |acc: Rc, stmt: Rc| { + |acc: _, stmt: Rc| { let stmt_edges = collect_scc_child_edges( stmt.clone(), caller.clone(), @@ -6661,29 +6662,62 @@ pub fn collect_scc_proof_edges_for_dim( Rc::new({ let mut __result = Vec::new(); for name in members.clone().iter().cloned() { - __result.extend((*match v1_rt::map_get(&func_index, name.clone()) { - Some(entry) => { - let best_map = entry.params.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |best: Rc>, p: Rc| { - let pname = param_node_name_at(p.clone(), si.clone()); -let descent_vars = collect_descent_vars(entry.body.clone(), pname.clone(), v1_rt::rc_empty_map::(), check_child.clone(), check_list.clone(), si.clone()); -let param_edges = collect_scc_child_edges(entry.body.clone(), name.clone(), pname.clone(), descent_vars.clone(), scc_name_set.clone(), check_child.clone(), check_list.clone(), measure_params.clone(), si.clone()); -let param_map = param_edges.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |bm: Rc>, pe: Rc| merge_edge_evidence(bm, pe.clone())); -pick_best_param_edges(best, param_map.clone()) -}); -Rc::new({ let mut __result = Vec::new(); for callee in Rc::new(v1_rt::map_keys(&best_map)).iter().cloned() { __result.push({ - let ev = match v1_rt::map_get(&best_map, callee.clone()) { - Some(e) => e.clone(), - None => DescentEvidence::DescentUnknown, -}; -Rc::new(ProofEdge { - caller: name.clone(), - callee: callee.clone(), - evidence: Rc::new(vec![ev.clone()]), -}) -}); } __result }) -}, - None => Rc::new(vec![]), -}).iter().cloned()); + __result.extend( + (*match v1_rt::map_get(&func_index, name.clone()) { + Some(entry) => { + let best_map = entry.params.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |best: _, p: Rc| { + let pname = param_node_name_at(p.clone(), si.clone()); + let descent_vars = collect_descent_vars( + entry.body.clone(), + pname.clone(), + v1_rt::rc_empty_map::(), + check_child.clone(), + check_list.clone(), + si.clone(), + ); + let param_edges = collect_scc_child_edges( + entry.body.clone(), + name.clone(), + pname.clone(), + descent_vars.clone(), + scc_name_set.clone(), + check_child.clone(), + check_list.clone(), + measure_params.clone(), + si.clone(), + ); + let param_map = param_edges.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |bm: _, pe: _| merge_edge_evidence(bm, pe.clone()), + ); + pick_best_param_edges(best, param_map.clone()) + }, + ); + Rc::new({ + let mut __result = Vec::new(); + for callee in Rc::new(v1_rt::map_keys(&best_map)).iter().cloned() { + __result.push({ + let ev = match v1_rt::map_get(&best_map, callee.clone()) { + Some(e) => e.clone(), + None => DescentEvidence::DescentUnknown, + }; + Rc::new(ProofEdge { + caller: name.clone(), + callee: callee.clone(), + evidence: Rc::new(vec![ev.clone()]), + }) + }); + } + __result + }) + } + None => Rc::new(vec![]), + }) + .iter() + .cloned(), + ); } __result }) @@ -6736,42 +6770,112 @@ pub fn collect_scc_independent_dim_edges( Rc::new({ let mut __result = Vec::new(); for name in members.clone().iter().cloned() { - __result.extend((*match v1_rt::map_get(&func_index, name.clone()) { - Some(entry) => { - let tree_edge_map = entry.params.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |best_map: Rc>, p: Rc| { - let pname = param_node_name_at(p.clone(), si.clone()); -let tree_vars = collect_descent_vars(entry.body.clone(), pname.clone(), v1_rt::rc_empty_map::(), true, false, si.clone()); -let param_edges = collect_scc_child_edges(entry.body.clone(), name.clone(), pname.clone(), tree_vars.clone(), scc_name_set.clone(), true, false, measure_params.clone(), si.clone()); -let param_map = param_edges.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |bm: Rc>, pe: Rc| merge_edge_evidence(bm, pe.clone())); -pick_best_param_edges(best_map, param_map.clone()) -}); -let list_edge_map = entry.params.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |best_map: Rc>, p: Rc| { - let pname = param_node_name_at(p.clone(), si.clone()); -let list_vars = collect_descent_vars(entry.body.clone(), pname.clone(), v1_rt::rc_empty_map::(), false, true, si.clone()); -let param_edges = collect_scc_child_edges(entry.body.clone(), name.clone(), pname.clone(), list_vars.clone(), scc_name_set.clone(), false, true, measure_params.clone(), si.clone()); -let param_map = param_edges.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |bm: Rc>, pe: Rc| merge_edge_evidence(bm, pe.clone())); -pick_best_param_edges(best_map, param_map.clone()) -}); -let all_keys = v1_rt::concat(Rc::new(v1_rt::map_keys(&tree_edge_map)), Rc::new(v1_rt::map_keys(&list_edge_map))); -let unique_keys = all_keys.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |acc: Rc>, k: String| v1_rt::rc_map_insert(acc, k.clone(), true)); -Rc::new({ let mut __result = Vec::new(); for callee in Rc::new(v1_rt::map_keys(&unique_keys)).iter().cloned() { __result.push({ - let tree_ev = match v1_rt::map_get(&tree_edge_map, callee.clone()) { - Some(ev) => ev.clone(), - None => DescentEvidence::DescentUnknown, -}; -let list_ev = match v1_rt::map_get(&list_edge_map, callee.clone()) { - Some(ev) => ev.clone(), - None => DescentEvidence::DescentUnknown, -}; -Rc::new(ProofEdge { - caller: name.clone(), - callee: callee.clone(), - evidence: Rc::new(vec![tree_ev.clone(), list_ev.clone()]), -}) -}); } __result }) -}, - None => Rc::new(vec![]), -}).iter().cloned()); + __result.extend( + (*match v1_rt::map_get(&func_index, name.clone()) { + Some(entry) => { + let tree_edge_map = entry.params.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |best_map: _, p: Rc| { + let pname = param_node_name_at(p.clone(), si.clone()); + let tree_vars = collect_descent_vars( + entry.body.clone(), + pname.clone(), + v1_rt::rc_empty_map::(), + true, + false, + si.clone(), + ); + let param_edges = collect_scc_child_edges( + entry.body.clone(), + name.clone(), + pname.clone(), + tree_vars.clone(), + scc_name_set.clone(), + true, + false, + measure_params.clone(), + si.clone(), + ); + let param_map = param_edges.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |bm: _, pe: _| merge_edge_evidence(bm, pe.clone()), + ); + pick_best_param_edges(best_map, param_map.clone()) + }, + ); + let list_edge_map = entry.params.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |best_map: _, p: Rc| { + let pname = param_node_name_at(p.clone(), si.clone()); + let list_vars = collect_descent_vars( + entry.body.clone(), + pname.clone(), + v1_rt::rc_empty_map::(), + false, + true, + si.clone(), + ); + let param_edges = collect_scc_child_edges( + entry.body.clone(), + name.clone(), + pname.clone(), + list_vars.clone(), + scc_name_set.clone(), + false, + true, + measure_params.clone(), + si.clone(), + ); + let param_map = param_edges.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |bm: _, pe: _| merge_edge_evidence(bm, pe.clone()), + ); + pick_best_param_edges(best_map, param_map.clone()) + }, + ); + let all_keys = v1_rt::concat( + Rc::new(v1_rt::map_keys(&tree_edge_map)), + Rc::new(v1_rt::map_keys(&list_edge_map)), + ); + let unique_keys = all_keys.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |acc: Rc>, k: String| { + v1_rt::rc_map_insert(acc, k.clone(), true) + }, + ); + Rc::new({ + let mut __result = Vec::new(); + for callee in Rc::new(v1_rt::map_keys(&unique_keys)).iter().cloned() + { + __result.push({ + let tree_ev = + match v1_rt::map_get(&tree_edge_map, callee.clone()) { + Some(ev) => ev.clone(), + None => DescentEvidence::DescentUnknown, + }; + let list_ev = + match v1_rt::map_get(&list_edge_map, callee.clone()) { + Some(ev) => ev.clone(), + None => DescentEvidence::DescentUnknown, + }; + Rc::new(ProofEdge { + caller: name.clone(), + callee: callee.clone(), + evidence: Rc::new(vec![ + tree_ev.clone(), + list_ev.clone(), + ]), + }) + }); + } + __result + }) + } + None => Rc::new(vec![]), + }) + .iter() + .cloned(), + ); } __result }) @@ -6823,37 +6927,105 @@ pub fn collect_scc_tree_parser_dim_edges( Rc::new({ let mut __result = Vec::new(); for name in members.clone().iter().cloned() { - __result.extend((*match v1_rt::map_get(&func_index, name.clone()) { - Some(entry) => { - let tree_edge_map = entry.params.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |best_map: Rc>, p: Rc| { - let pname = param_node_name_at(p.clone(), si.clone()); -let tree_vars = collect_descent_vars(entry.body.clone(), pname.clone(), v1_rt::rc_empty_map::(), true, false, si.clone()); -let param_edges = collect_scc_child_edges(entry.body.clone(), name.clone(), pname.clone(), tree_vars.clone(), scc_name_set.clone(), true, false, measure_params.clone(), si.clone()); -let param_map = param_edges.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |bm: Rc>, pe: Rc| merge_edge_evidence(bm, pe.clone())); -pick_best_param_edges(best_map, param_map.clone()) -}); -let my_parser_edges = Rc::new({ let mut __result = Vec::new(); for pe in all_parser_edges.clone().iter().cloned() { if (pe.caller.clone() == name.clone()) { __result.push(pe); } } __result }); -let parser_edge_map = my_parser_edges.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |bm: Rc>, pe: Rc| merge_edge_evidence(bm, pe.clone())); -let all_keys = v1_rt::concat(Rc::new(v1_rt::map_keys(&tree_edge_map)), Rc::new(v1_rt::map_keys(&parser_edge_map))); -let unique_keys = all_keys.clone().iter().cloned().fold(v1_rt::rc_empty_map::(), |acc: Rc>, k: String| v1_rt::rc_map_insert(acc, k.clone(), true)); -Rc::new({ let mut __result = Vec::new(); for callee in Rc::new(v1_rt::map_keys(&unique_keys)).iter().cloned() { __result.push({ - let tree_ev = match v1_rt::map_get(&tree_edge_map, callee.clone()) { - Some(ev) => ev.clone(), - None => DescentEvidence::DescentUnknown, -}; -let parser_ev = match v1_rt::map_get(&parser_edge_map, callee.clone()) { - Some(ev) => ev.clone(), - None => DescentEvidence::DescentUnknown, -}; -Rc::new(ProofEdge { - caller: name.clone(), - callee: callee.clone(), - evidence: Rc::new(vec![tree_ev.clone(), parser_ev.clone()]), -}) -}); } __result }) -}, - None => Rc::new(vec![]), -}).iter().cloned()); + __result.extend( + (*match v1_rt::map_get(&func_index, name.clone()) { + Some(entry) => { + let tree_edge_map = entry.params.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |best_map: _, p: Rc| { + let pname = param_node_name_at(p.clone(), si.clone()); + let tree_vars = collect_descent_vars( + entry.body.clone(), + pname.clone(), + v1_rt::rc_empty_map::(), + true, + false, + si.clone(), + ); + let param_edges = collect_scc_child_edges( + entry.body.clone(), + name.clone(), + pname.clone(), + tree_vars.clone(), + scc_name_set.clone(), + true, + false, + measure_params.clone(), + si.clone(), + ); + let param_map = + param_edges.clone().iter().cloned().fold( + v1_rt::rc_empty_map::( + ), + |bm: _, pe: _| { + merge_edge_evidence(bm, pe.clone()) + }, + ); + pick_best_param_edges(best_map, param_map.clone()) + }, + ); + let my_parser_edges = Rc::new({ + let mut __result = Vec::new(); + for pe in all_parser_edges.clone().iter().cloned() { + if (pe.caller.clone() == name.clone()) { + __result.push(pe); + } + } + __result + }); + let parser_edge_map = + my_parser_edges.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |bm: _, pe: _| merge_edge_evidence(bm, pe.clone()), + ); + let all_keys = v1_rt::concat( + Rc::new(v1_rt::map_keys(&tree_edge_map)), + Rc::new(v1_rt::map_keys(&parser_edge_map)), + ); + let unique_keys = all_keys.clone().iter().cloned().fold( + v1_rt::rc_empty_map::(), + |acc: Rc>, k: String| { + v1_rt::rc_map_insert(acc, k.clone(), true) + }, + ); + Rc::new({ + let mut __result = Vec::new(); + for callee in + Rc::new(v1_rt::map_keys(&unique_keys)).iter().cloned() + { + __result.push({ + let tree_ev = match v1_rt::map_get( + &tree_edge_map, + callee.clone(), + ) { + Some(ev) => ev.clone(), + None => DescentEvidence::DescentUnknown, + }; + let parser_ev = match v1_rt::map_get( + &parser_edge_map, + callee.clone(), + ) { + Some(ev) => ev.clone(), + None => DescentEvidence::DescentUnknown, + }; + Rc::new(ProofEdge { + caller: name.clone(), + callee: callee.clone(), + evidence: Rc::new(vec![ + tree_ev.clone(), + parser_ev.clone(), + ]), + }) + }); + } + __result + }) + } + None => Rc::new(vec![]), + }) + .iter() + .cloned(), + ); } __result }) @@ -6874,81 +7046,163 @@ pub fn collect_scc_cx_l2_tree_edges( Rc::new({ let mut __result = Vec::new(); for name in members.clone().iter().cloned() { - __result.extend((*match v1_rt::map_get(&func_index, name.clone()) { - Some(entry) => { - let self_evidence = collect_self_call_evidence(entry.body.clone(), name.clone(), si.clone()); -let self_has_calls = ((self_evidence.clone().len() as i64) > 0); -let self_all_structural = (self_has_calls.clone() && { let mut __all = true; for call_ev in self_evidence.clone().iter().cloned() { if !({ let mut __found = false; for rel in call_ev.clone().iter().cloned() { if match (*rel.clone()).clone() { - SubValueRelation::StrictSubValue { .. } => true, - SubValueRelation::IteratedSubValue { field: _, .. } => true, - SubValueRelation::ArithmeticDescent { .. } => true, - _ => false, -} { __found = true; break; } } __found }) { __all = false; break; } } __all }); -let descending_param = match self_evidence.clone().first().cloned() { - Some(call_ev) => call_ev.clone().iter().cloned().fold("".to_string(), |found: String, rel: Rc| if (found.clone() != "".to_string()) { - found.clone() - } else { - match (*rel.clone()).clone() { - SubValueRelation::StrictSubValue { field: f, .. } => f.element_type.clone(), - SubValueRelation::IteratedSubValue { field: f, .. } => f.element_type.clone(), - SubValueRelation::ArithmeticDescent { param: p, .. } => p.clone(), - _ => "".to_string(), -} - }), - None => "".to_string(), -}; -let self_edge = if self_has_calls.clone() { - if self_all_structural.clone() { - { - let derived = self_evidence.clone().iter().cloned().fold(DescentEvidence::Strict, |worst: DescentEvidence, call_ev: Rc>>| { - let call_best = call_ev.clone().iter().cloned().fold(DescentEvidence::DescentUnknown, |best: DescentEvidence, rel: Rc| { - let ev = sub_value_to_evidence(rel.clone()); -match ev.clone() { - DescentEvidence::Strict => DescentEvidence::Strict, - _ => match best { - DescentEvidence::Strict => DescentEvidence::Strict, - _ => ev.clone(), -}, -} -}); -descent_evidence_lattice_meet(worst, call_best.clone()) -}); -Rc::new(vec![Rc::new(ProofEdge { - caller: name.clone(), - callee: name.clone(), - evidence: Rc::new(vec![derived.clone()]), -})]) -} - } else { - Rc::new(vec![Rc::new(ProofEdge { - caller: name.clone(), - callee: name.clone(), - evidence: Rc::new(vec![DescentEvidence::DescentUnknown]), -})]) - } - } else { - Rc::new(vec![]) - }; -let other_members = Rc::new({ let mut __result = Vec::new(); for m in Rc::new(v1_rt::map_keys(&scc_name_set)).iter().cloned() { if (m.clone() != name.clone()) { __result.push(m); } } __result }); -let cross_edges = Rc::new({ let mut __result = Vec::new(); for callee in other_members.clone().iter().cloned() { __result.extend((*{ - let callee_evidence = collect_callee_evidence(entry.body.clone(), callee.clone(), si.clone()); -if ((callee_evidence.clone().len() as i64) > 0) { - { - let ev = derive_edge_evidence(callee_evidence.clone()); -Rc::new(vec![Rc::new(ProofEdge { - caller: name.clone(), - callee: callee.clone(), - evidence: Rc::new(vec![ev.clone()]), -})]) -} - } else { - Rc::new(vec![]) - } -}).iter().cloned()); } __result }); -v1_rt::concat(self_edge.clone(), cross_edges.clone()) -}, - None => Rc::new(vec![]), -}).iter().cloned()); + __result.extend( + (*match v1_rt::map_get(&func_index, name.clone()) { + Some(entry) => { + let self_evidence = collect_self_call_evidence( + entry.body.clone(), + name.clone(), + si.clone(), + ); + let self_has_calls = ((self_evidence.clone().len() as i64) > 0); + let self_all_structural = (self_has_calls.clone() && { + let mut __all = true; + for call_ev in self_evidence.clone().iter().cloned() { + if !({ + let mut __found = false; + for rel in call_ev.clone().iter().cloned() { + if match (*rel.clone()).clone() { + SubValueRelation::StrictSubValue { .. } => true, + SubValueRelation::IteratedSubValue { + field: _, + .. + } => true, + SubValueRelation::ArithmeticDescent { .. } => true, + _ => false, + } { + __found = true; + break; + } + } + __found + }) { + __all = false; + break; + } + } + __all + }); + let descending_param = match self_evidence.clone().first().cloned() { + Some(call_ev) => call_ev.clone().iter().cloned().fold( + "".to_string(), + |found: String, rel: _| { + if (found.clone() != "".to_string()) { + found.clone() + } else { + match (*rel.clone()).clone() { + SubValueRelation::StrictSubValue { + field: f, + .. + } => f.element_type.clone(), + SubValueRelation::IteratedSubValue { + field: f, + .. + } => f.element_type.clone(), + SubValueRelation::ArithmeticDescent { + param: p, + .. + } => p.clone(), + _ => "".to_string(), + } + } + }, + ), + None => "".to_string(), + }; + let self_edge = if self_has_calls.clone() { + if self_all_structural.clone() { + { + let derived = self_evidence.clone().iter().cloned().fold( + DescentEvidence::Strict, + |worst: DescentEvidence, call_ev: _| { + let call_best = + call_ev.clone().iter().cloned().fold( + DescentEvidence::DescentUnknown, + |best: DescentEvidence, rel: _| { + let ev = + sub_value_to_evidence(rel.clone()); + match ev.clone() { + DescentEvidence::Strict => { + DescentEvidence::Strict + } + _ => match best { + DescentEvidence::Strict => { + DescentEvidence::Strict + } + _ => ev.clone(), + }, + } + }, + ); + descent_evidence_lattice_meet( + worst, + call_best.clone(), + ) + }, + ); + Rc::new(vec![Rc::new(ProofEdge { + caller: name.clone(), + callee: name.clone(), + evidence: Rc::new(vec![derived.clone()]), + })]) + } + } else { + Rc::new(vec![Rc::new(ProofEdge { + caller: name.clone(), + callee: name.clone(), + evidence: Rc::new(vec![DescentEvidence::DescentUnknown]), + })]) + } + } else { + Rc::new(vec![]) + }; + let other_members = Rc::new({ + let mut __result = Vec::new(); + for m in Rc::new(v1_rt::map_keys(&scc_name_set)).iter().cloned() { + if (m.clone() != name.clone()) { + __result.push(m); + } + } + __result + }); + let cross_edges = Rc::new({ + let mut __result = Vec::new(); + for callee in other_members.clone().iter().cloned() { + __result.extend( + (*{ + let callee_evidence = collect_callee_evidence( + entry.body.clone(), + callee.clone(), + si.clone(), + ); + if ((callee_evidence.clone().len() as i64) > 0) { + { + let ev = derive_edge_evidence( + callee_evidence.clone(), + ); + Rc::new(vec![Rc::new(ProofEdge { + caller: name.clone(), + callee: callee.clone(), + evidence: Rc::new(vec![ev.clone()]), + })]) + } + } else { + Rc::new(vec![]) + } + }) + .iter() + .cloned(), + ); + } + __result + }); + v1_rt::concat(self_edge.clone(), cross_edges.clone()) + } + None => Rc::new(vec![]), + }) + .iter() + .cloned(), + ); } __result }) @@ -6978,7 +7232,7 @@ pub fn scc_descending_param( match evidence.clone().first().cloned() { Some(call_ev) => call_ev.clone().iter().cloned().fold( "".to_string(), - |p: String, rel: Rc| { + |p: String, rel: _| { if (p.clone() != "".to_string()) { p.clone() } else { @@ -7392,7 +7646,7 @@ pub fn build_scc_index( assigned: v1_rt::rc_empty_set::(), index: v1_rt::rc_empty_map::>(), }), - |acc: Rc, name: String| { + |acc: _, name: String| { if v1_rt::set_contains(&acc.assigned.clone(), name.clone()) { acc.clone() } else { @@ -7435,7 +7689,7 @@ pub fn build_scc_index( }); let next_index = members.clone().iter().cloned().fold( acc.index.clone(), - |inner: Rc>>, member: String| { + |inner: _, member: String| { v1_rt::rc_map_insert(inner, member.clone(), info.clone()) }, ); @@ -9730,7 +9984,7 @@ pub fn collect_call_evidence( } _ => body.children.clone().iter().cloned().fold( Rc::new(vec![]), - |acc: Rc>>>>, child: Rc| { + |acc: _, child: Rc| { v1_rt::concat( acc, collect_call_evidence(child.clone(), target_set.clone(), si.clone()), @@ -9772,10 +10026,10 @@ pub fn collect_callee_evidence( pub fn derive_edge_evidence(all_calls: Rc>>>>) -> DescentEvidence { all_calls.clone().iter().cloned().fold( DescentEvidence::Strict, - |worst: DescentEvidence, call_ev: Rc>>| { + |worst: DescentEvidence, call_ev: _| { let call_best = call_ev.clone().iter().cloned().fold( DescentEvidence::DescentUnknown, - |best: DescentEvidence, rel: Rc| { + |best: DescentEvidence, rel: _| { let ev = sub_value_to_evidence(rel.clone()); match ev.clone() { DescentEvidence::Strict => DescentEvidence::Strict, @@ -9798,7 +10052,7 @@ pub fn merge_param_evidence( ) -> DescentEvidence { all_calls.clone().iter().cloned().fold( DescentEvidence::Strict, - |acc: DescentEvidence, call_evidence: Rc>>| match call_evidence + |acc: DescentEvidence, call_evidence: _| match call_evidence .clone() .iter() .cloned() @@ -9819,9 +10073,7 @@ pub fn extract_shrink_factor( ) -> Option> { all_calls.clone().iter().cloned().fold( Some(Rc::new(ShrinkFactor::UnitShrink)), - |acc: Option>, call_evidence: Rc>>| match acc - .clone() - { + |acc: Option>, call_evidence: _| match acc.clone() { None => None, Some(prev) => match call_evidence .clone() @@ -9994,25 +10246,23 @@ pub fn distinct_descended_fields( { let field_set = all_calls.clone().iter().cloned().fold( v1_rt::rc_empty_map::(), - |acc: Rc>, call_evidence: Rc>>| { - match call_evidence - .clone() - .iter() - .cloned() - .skip(param_index.clone() as usize) - .next() - { - Some(rel) => match (*rel.clone()).clone() { - SubValueRelation::StrictSubValue { field: f, .. } => { - v1_rt::rc_map_insert(acc.clone(), f.field_name.clone(), true) - } - SubValueRelation::IteratedSubValue { field: f, .. } => { - v1_rt::rc_map_insert(acc.clone(), f.field_name.clone(), true) - } - _ => acc.clone(), - }, - None => acc.clone(), - } + |acc: Rc>, call_evidence: _| match call_evidence + .clone() + .iter() + .cloned() + .skip(param_index.clone() as usize) + .next() + { + Some(rel) => match (*rel.clone()).clone() { + SubValueRelation::StrictSubValue { field: f, .. } => { + v1_rt::rc_map_insert(acc.clone(), f.field_name.clone(), true) + } + SubValueRelation::IteratedSubValue { field: f, .. } => { + v1_rt::rc_map_insert(acc.clone(), f.field_name.clone(), true) + } + _ => acc.clone(), + }, + None => acc.clone(), }, ); (Rc::new(v1_rt::map_keys(&field_set)).len() as i64) @@ -10150,10 +10400,7 @@ pub fn build_complexity_report( infer_all_parser_always_advancing(func_index.clone(), si.clone()); let full_scc_index = func_entries.clone().iter().cloned().fold( scc_result.index.clone(), - |acc: Rc>>, entry: Rc| match v1_rt::map_get( - &acc, - entry.name.clone(), - ) { + |acc: _, entry: Rc| match v1_rt::map_get(&acc, entry.name.clone()) { Some(_) => acc.clone(), None => { if (max_path_self_calls(entry.body.clone(), entry.name.clone(), si.clone()) > 0) diff --git a/src/v1/stage0/src/v1_compiler_dag_collect.rs b/src/v1/stage0/src/v1_compiler_dag_collect.rs index cb238559346..53bc8d6d7cc 100644 --- a/src/v1/stage0/src/v1_compiler_dag_collect.rs +++ b/src/v1/stage0/src/v1_compiler_dag_collect.rs @@ -258,7 +258,7 @@ pub fn collect_dag_nodes(typed: Rc) -> Rc { let collision_errors = Rc::new(vec![]); let slots = typed.modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |s: Rc>>, m: Rc| { + |s: Rc>>, m: _| { dag_collect_from_module(m.clone(), s, collision_errors.clone()) }, ); diff --git a/src/v1/stage0/src/v1_compiler_emit_go.rs b/src/v1/stage0/src/v1_compiler_emit_go.rs index 6eac83e9046..466ff6b299b 100644 --- a/src/v1/stage0/src/v1_compiler_emit_go.rs +++ b/src/v1/stage0/src/v1_compiler_emit_go.rs @@ -1278,17 +1278,18 @@ pub fn emit_go_func_def( ); let body_scope = build_params_scope(scope.clone(), params.clone()); let si = scope.type_env.clone().source_indices.clone(); - let body_scope = uses.clone().iter().cloned().fold( - body_scope.clone(), - |s: Rc, u: Rc| { - extend_scope( - s, - resource_use_name_at(u.clone(), si.clone()), - resource_use_resource(u.clone()), - Rc::new(SubValueRelation::SubValueUnknown), - ) - }, - ); + let body_scope = + uses.clone() + .iter() + .cloned() + .fold(body_scope.clone(), |s: _, u: Rc| { + extend_scope( + s, + resource_use_name_at(u.clone(), si.clone()), + resource_use_resource(u.clone()), + Rc::new(SubValueRelation::SubValueUnknown), + ) + }); let body_str = emit_unified_typed_func_body( body.clone(), RenderTarget::Go, diff --git a/src/v1/stage0/src/v1_compiler_emit_python.rs b/src/v1/stage0/src/v1_compiler_emit_python.rs index 8135ac956a3..0cf15788329 100644 --- a/src/v1/stage0/src/v1_compiler_emit_python.rs +++ b/src/v1/stage0/src/v1_compiler_emit_python.rs @@ -1010,17 +1010,18 @@ pub fn emit_py_func_def( ); let body_scope = build_params_scope(scope.clone(), params.clone()); let si = scope.type_env.clone().source_indices.clone(); - let body_scope = uses.clone().iter().cloned().fold( - body_scope.clone(), - |s: Rc, u: Rc| { - extend_scope( - s, - resource_use_name_at(u.clone(), si.clone()), - resource_use_resource(u.clone()), - Rc::new(SubValueRelation::SubValueUnknown), - ) - }, - ); + let body_scope = + uses.clone() + .iter() + .cloned() + .fold(body_scope.clone(), |s: _, u: Rc| { + extend_scope( + s, + resource_use_name_at(u.clone(), si.clone()), + resource_use_resource(u.clone()), + Rc::new(SubValueRelation::SubValueUnknown), + ) + }); let body_str = emit_unified_typed_func_body( body.clone(), RenderTarget::Python, diff --git a/src/v1/stage0/src/v1_compiler_emit_rust.rs b/src/v1/stage0/src/v1_compiler_emit_rust.rs index e59b5089498..e542586b030 100644 --- a/src/v1/stage0/src/v1_compiler_emit_rust.rs +++ b/src/v1/stage0/src/v1_compiler_emit_rust.rs @@ -3927,7 +3927,7 @@ pub fn resolve_local_coproduct_wire_policy( pub fn build_data_item_index(modules: Rc>>) -> Rc>> { modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, tm: Rc| { + |acc: Rc>>, tm: _| { let module_name = authored_name_at( tm.type_env.clone().source_indices.clone(), tm.module.clone(), @@ -4571,7 +4571,7 @@ pub fn build_shared_types( .cloned() .fold( v1_rt::rc_empty_set::(), - |acc: Rc>, summary: Rc| { + |acc: Rc>, summary: _| { maybe_mark_shared_type( acc, summary.clone(), @@ -4619,31 +4619,33 @@ pub struct OwnershipBuildResult { pub fn build_ownership_results(modules: Rc>>) -> Rc { { - let callable_set = modules.clone().iter().cloned().fold( - v1_rt::rc_empty_set::<_>(), - |acc: _, m: Rc| { - Rc::new({ - let mut __result = Vec::new(); - for item in m.items.clone().iter().cloned() { - if (item.body.clone() != None) { - __result.push(item); - } - } - __result - }) + let callable_set = + modules + .clone() .iter() .cloned() - .fold(acc, |inner: _, item: Rc| { - v1_rt::rc_set_union( - inner, - collect_callable_refs( - item.body.clone().clone().unwrap(), - m.type_env.clone().source_indices.clone(), - ), - ) - }) - }, - ); + .fold(v1_rt::rc_empty_set::<_>(), |acc: _, m: _| { + Rc::new({ + let mut __result = Vec::new(); + for item in m.items.clone().iter().cloned() { + if (item.body.clone() != None) { + __result.push(item); + } + } + __result + }) + .iter() + .cloned() + .fold(acc, |inner: _, item: Rc| { + v1_rt::rc_set_union( + inner, + collect_callable_refs( + item.body.clone().clone().unwrap(), + m.type_env.clone().source_indices.clone(), + ), + ) + }) + }); let proofs = Rc::new({ let mut __result = Vec::new(); for m in modules.clone().iter().cloned() { @@ -4708,7 +4710,7 @@ pub fn build_ownership_results(modules: Rc>>) -> Rc>>(), read_only_params_index: v1_rt::rc_empty_map::>>(), }), - |acc: Rc, entry: Rc| { + |acc: Rc, entry: _| { let acc = v1_rt::take_owned(acc); { let read_only = if v1_rt::set_contains( @@ -4743,11 +4745,7 @@ pub fn group_unlisted_type_names( ) -> Rc>>> { diags.clone().iter().cloned().fold( v1_rt::rc_empty_map::>>(), - |acc: Rc>>>, en: Rc| match (*en - .diagnostic - .clone()) - .clone() - { + |acc: Rc>>>, en: _| match (*en.diagnostic.clone()).clone() { CompilerDiagnostic::UnlistedImportUse { name: nm, .. } => { let existing = match v1_rt::map_get(&acc, en.module_name.clone()) { Some(v) => v.clone(), @@ -4809,7 +4807,7 @@ pub fn emit_rust(typed: Rc) -> Rc { } let svc_module_map = typed.modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::(), - |acc: Rc>, tm: Rc| { + |acc: Rc>, tm: _| { let svc_items = Rc::new({ let mut __result = Vec::new(); for item in tm.items.clone().iter().cloned() { @@ -5202,7 +5200,7 @@ pub fn build_module_export_sets( ) -> Rc>>> { modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>>(), - |acc: Rc>>>, tm: Rc| { + |acc: Rc>>>, tm: _| { let m_name = authored_name_at( tm.type_env.clone().source_indices.clone(), tm.module.clone(), @@ -7195,7 +7193,7 @@ pub fn build_module_index(modules: Rc>>) -> Rc { let by_name = modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, tm: Rc| { + |acc: _, tm: _| { let nm = authored_name_at( tm.type_env.clone().source_indices.clone(), tm.module.clone(), @@ -7208,7 +7206,7 @@ pub fn build_module_index(modules: Rc>>) -> Rc ); let by_filename = modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>>>(), - |acc: Rc>>>>, tm: Rc| { + |acc: _, tm: _| { let fname = module_to_filename(authored_name_at( tm.type_env.clone().source_indices.clone(), tm.module.clone(), @@ -14345,17 +14343,18 @@ pub fn emit_func_def( ); let body_scope = build_params_scope(scope.clone(), params.clone()); let si = scope.type_env.clone().source_indices.clone(); - let body_scope = uses.clone().iter().cloned().fold( - body_scope.clone(), - |s: Rc, u: Rc| { - extend_scope( - s, - resource_use_name_at(u.clone(), si.clone()), - resource_use_resource(u.clone()), - Rc::new(SubValueRelation::SubValueUnknown), - ) - }, - ); + let body_scope = + uses.clone() + .iter() + .cloned() + .fold(body_scope.clone(), |s: _, u: Rc| { + extend_scope( + s, + resource_use_name_at(u.clone(), si.clone()), + resource_use_resource(u.clone()), + Rc::new(SubValueRelation::SubValueUnknown), + ) + }); let body_str = emit_func_body( body.clone(), registry.clone(), @@ -19752,7 +19751,7 @@ pub fn lambda_scope_from_children( ) .iter() .cloned() - .fold(scope.clone(), |acc: Rc, pair: (i64, String)| { + .fold(scope.clone(), |acc: _, pair: (i64, String)| { let idx = pair.0.clone(); let param_name = pair.1.clone(); let param_type = match param_nodes @@ -29408,7 +29407,7 @@ pub fn extract_literal_string(expr: Rc) -> Option { pub fn build_data_body_index(modules: Rc>>) -> Rc>> { modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, tm: Rc| { + |acc: Rc>>, tm: _| { tm.items.clone().iter().cloned().fold( acc, |inner: Rc>>, i: Rc| match i.body.clone() { diff --git a/src/v1/stage0/src/v1_compiler_infer.rs b/src/v1/stage0/src/v1_compiler_infer.rs index f7d5cd69381..5af77f54e46 100644 --- a/src/v1/stage0/src/v1_compiler_infer.rs +++ b/src/v1/stage0/src/v1_compiler_infer.rs @@ -424,7 +424,7 @@ pub fn merge_scope_from_imports( svc_registry: svc_registry.clone(), svc_locals: svc_locals.clone(), }), - |acc: Rc, titem: Rc| { + |acc: _, titem: Rc| { if ((titem.transport.clone() != None) && ((titem.children.clone().len() as i64) > 0)) { @@ -650,10 +650,13 @@ pub fn collect_fields_inductive( acc: Rc>>>>, source_indices: Rc>>, ) -> Rc>>>> { - fields.clone().iter().cloned().fold( - acc.clone(), - |field_acc: Rc>>>>, field_node: Rc| { - match classify_field_recursion( + fields + .clone() + .iter() + .cloned() + .fold( + acc.clone(), + |field_acc: _, field_node: Rc| match classify_field_recursion( field_node.clone(), parent_name.clone(), recursive_type_set.clone(), @@ -668,9 +671,8 @@ pub fn collect_fields_inductive( result.element_type.clone(), ), None => field_acc.clone(), - } - }, - ) + }, + ) } pub fn collect_item_inductive_fields( @@ -683,8 +685,7 @@ pub fn collect_item_inductive_fields( match item.connective.clone() { Connective::Disj => item.children.clone().iter().cloned().fold( v1_rt::rc_empty_map::>>>(), - |variant_acc: Rc>>>>, - variant_node: Rc| { + |variant_acc: _, variant_node: Rc| { collect_fields_inductive( variant_node.children.clone(), item_name.clone(), @@ -715,7 +716,7 @@ pub fn build_item_inductive_fields( ) -> Rc>>>> { items.clone().iter().cloned().fold( v1_rt::rc_empty_map::>>>(), - |acc: Rc>>>>, item: Rc| { + |acc: _, item: Rc| { merge_inductive_fields( acc, collect_item_inductive_fields( @@ -3009,23 +3010,28 @@ pub fn annotate_pattern_parent_enums( pub fn build_params_scope(scope: Rc, params: Rc>>) -> Rc { { - let new_locals = params.clone().iter().cloned().fold( - scope.locals.clone(), - |acc: Rc>>, p: Rc| { - v1_rt::rc_map_insert( - acc, - param_node_name_at(p.clone(), scope.type_env.clone().source_indices.clone()), - Rc::new(TypeBinding { - name: param_node_name_at( + let new_locals = + params + .clone() + .iter() + .cloned() + .fold(scope.locals.clone(), |acc: _, p: Rc| { + v1_rt::rc_map_insert( + acc, + param_node_name_at( p.clone(), scope.type_env.clone().source_indices.clone(), ), - resolved: param_node_type_expr(p.clone()), - provenance: Rc::new(SubValueRelation::PreservedValue), - }), - ) - }, - ); + Rc::new(TypeBinding { + name: param_node_name_at( + p.clone(), + scope.type_env.clone().source_indices.clone(), + ), + resolved: param_node_type_expr(p.clone()), + provenance: Rc::new(SubValueRelation::PreservedValue), + }), + ) + }); let new_body_locals = params.clone().iter().cloned().fold( scope.body_locals.clone(), |acc: Rc>, p: Rc| { @@ -3110,20 +3116,22 @@ pub fn extend_scope_match_bound( pub fn extend_scope_with_params(scope: Rc, params: Rc>) -> Rc { { - let new_locals = params.clone().iter().cloned().fold( - scope.locals.clone(), - |acc: Rc>>, p: String| { - v1_rt::rc_map_insert( - acc, - p.clone(), - Rc::new(TypeBinding { - name: p.clone(), - resolved: type_variable_node("lambda_param".to_string()), - provenance: Rc::new(SubValueRelation::SubValueUnknown), - }), - ) - }, - ); + let new_locals = + params + .clone() + .iter() + .cloned() + .fold(scope.locals.clone(), |acc: _, p: String| { + v1_rt::rc_map_insert( + acc, + p.clone(), + Rc::new(TypeBinding { + name: p.clone(), + resolved: type_variable_node("lambda_param".to_string()), + provenance: Rc::new(SubValueRelation::SubValueUnknown), + }), + ) + }); let new_body_locals = params.clone().iter().cloned().fold( scope.body_locals.clone(), |acc: Rc>, p: String| v1_rt::rc_map_insert(acc, p.clone(), true), @@ -3270,7 +3278,7 @@ pub fn extend_scope_with_pattern_node( scope: scope.clone(), diagnostics: variant_diags.clone(), }), - |acc: Rc, fb: Rc| { + |acc: _, fb: Rc| { let field_name = field_binding_name_at( fb.clone(), scope.type_env.clone().source_indices.clone(), @@ -4305,7 +4313,7 @@ pub fn infer_expr_body( results: Rc::new(vec![]), subst: v1_rt::rc_empty_map::>(), }), - |st: Rc, pair: (i64, Rc)| { + |st: _, pair: (i64, Rc)| { let a = pair.1.clone(); let formal_lookup = value_params .clone() @@ -5982,7 +5990,7 @@ match bare_s.clone() { .cloned() .fold( scope.clone(), - |acc: Rc, pair: (i64, String)| { + |acc: _, pair: (i64, String)| { let param_prov = if (pair.0.clone() == ((lam_params.clone().len() as i64) - 1)) { @@ -6038,7 +6046,7 @@ match bare_s.clone() { .cloned() .fold( scope.clone(), - |acc: Rc, pair: (i64, String)| { + |acc: _, pair: (i64, String)| { let param_prov = if (pair.0.clone() == ((lam_params.clone().len() as i64) - 1)) { @@ -8292,8 +8300,7 @@ pub fn build_per_field_for_let( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, - pair: (i64, Rc)| { + |acc: _, pair: (i64, Rc)| { let idx = pair.0.clone(); let field_node = pair.1.clone(); let fname = authored_name_at( @@ -8356,8 +8363,7 @@ pub fn build_per_field_for_let( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, - pair: (i64, Rc)| { + |acc: _, pair: (i64, Rc)| { let idx = pair.0.clone(); let field_node = pair.1.clone(); let fname = authored_name_at( @@ -9168,10 +9174,9 @@ pub fn merge_argument_relations(rels: Rc>>) -> Rc, rel: Rc| meet_sub_value(acc, rel.clone()), - ), + .fold(first_rel.clone(), |acc: _, rel: _| { + meet_sub_value(acc, rel.clone()) + }), } } @@ -10078,7 +10083,7 @@ let arm_ctx = match variant_arm_ctx.clone() { match (*arm_pattern(arm_node.clone())).clone() { MatchPattern::VariantPattern { name: vname, field_bindings: bindings, .. } => match scrut_inducing_field.clone() { Some(ind_field) => if (vname.clone() == "Present".to_string()) { - bindings.clone().iter().cloned().fold(ctx.clone(), |c: Rc, fb: Rc| match (*field_binding_pattern(fb.clone())).clone() { + bindings.clone().iter().cloned().fold(ctx.clone(), |c: _, fb: Rc| match (*field_binding_pattern(fb.clone())).clone() { MatchPattern::Bind { declaration: declaration, .. } => Rc::new(DescentContext { fn_name: c.fn_name.clone(), param_names: v1_rt::rc_map_insert(c.param_names.clone(), declaration.name.clone(), ind_field.element_type.clone()), @@ -10095,7 +10100,7 @@ let arm_ctx = match variant_arm_ctx.clone() { }), MatchPattern::VariantPattern { name: inner_vname, field_bindings: inner_bindings, .. } => { let inner_ind_fields = inductive_fields_for(c.type_env.clone(), ind_field.element_type.clone()); -inner_bindings.clone().iter().cloned().fold(c.clone(), |ic: Rc, inner_fb: Rc| { +inner_bindings.clone().iter().cloned().fold(c.clone(), |ic: _, inner_fb: Rc| { let inner_field_name = field_binding_name_at(inner_fb.clone(), ctx.type_env.clone().source_indices.clone()); let inner_bind_name = match (*field_binding_pattern(inner_fb.clone())).clone() { MatchPattern::Bind { declaration: declaration, .. } => declaration.name.clone(), @@ -10132,7 +10137,7 @@ match inner_matching.clone() { }, None => { let ind_fields = inductive_fields_for(ctx.type_env.clone(), scrut_type.clone()); -bindings.clone().iter().cloned().fold(ctx.clone(), |c: Rc, fb: Rc| { +bindings.clone().iter().cloned().fold(ctx.clone(), |c: _, fb: Rc| { let field_name = field_binding_name_at(fb.clone(), ctx.type_env.clone().source_indices.clone()); let bind_name = match (*field_binding_pattern(fb.clone())).clone() { MatchPattern::Bind { declaration: declaration, .. } => declaration.name.clone(), @@ -10344,7 +10349,7 @@ make_arm_node(arm_pattern(arm_node.clone()), arm_guard(arm_node.clone()), annota ctx: ctx.clone(), children: Rc::new(vec![]), }), - |acc: Rc, child: Rc| { + |acc: _, child: Rc| { let annotated = annotate_descent(child.clone(), acc.ctx.clone()); let next_ctx = match (*child.expr_data.clone()).clone() { ExprData::ExprLet => { @@ -10939,59 +10944,54 @@ pub fn classify_body_provenance( ); Rc::new(v1_rt::map_keys(&base_prov)).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, pname: String| { - match v1_rt::map_get(&base_prov, pname.clone()) { - Some(base_rel) => { - let type_for_lookup = match (*base_rel.clone()).clone() { - SubValueRelation::PreservedValue => { - match v1_rt::map_get(¶m_types, pname.clone()) { - Some(t) => t.clone(), - None => "".to_string(), - } - } - SubValueRelation::StrictSubValue { field: f, .. } => { - f.element_type.clone() - } - SubValueRelation::IteratedSubValue { field: f, .. } => { - f.element_type.clone() + |acc: _, pname: String| match v1_rt::map_get(&base_prov, pname.clone()) { + Some(base_rel) => { + let type_for_lookup = match (*base_rel.clone()).clone() { + SubValueRelation::PreservedValue => { + match v1_rt::map_get(¶m_types, pname.clone()) { + Some(t) => t.clone(), + None => "".to_string(), } - _ => "".to_string(), - }; - if (type_for_lookup.clone() != "".to_string()) { - { - let fields = inductive_fields_for( - type_env.clone(), - type_for_lookup.clone(), - ); - let matching = Rc::new({ - let mut __result = Vec::new(); - for f in fields.clone().iter().cloned() { - if (f.field_name.clone() == field.clone()) { - __result.push(f); - } + } + SubValueRelation::StrictSubValue { field: f, .. } => { + f.element_type.clone() + } + SubValueRelation::IteratedSubValue { field: f, .. } => { + f.element_type.clone() + } + _ => "".to_string(), + }; + if (type_for_lookup.clone() != "".to_string()) { + { + let fields = inductive_fields_for( + type_env.clone(), + type_for_lookup.clone(), + ); + let matching = Rc::new({ + let mut __result = Vec::new(); + for f in fields.clone().iter().cloned() { + if (f.field_name.clone() == field.clone()) { + __result.push(f); } - __result - }) - .first() - .cloned(); - match matching.clone() { - Some(ind_field) => v1_rt::rc_map_insert( - acc.clone(), - pname.clone(), - compose_sub_value( - base_rel.clone(), - ind_field.clone(), - ), - ), - None => acc.clone(), } + __result + }) + .first() + .cloned(); + match matching.clone() { + Some(ind_field) => v1_rt::rc_map_insert( + acc.clone(), + pname.clone(), + compose_sub_value(base_rel.clone(), ind_field.clone()), + ), + None => acc.clone(), } - } else { - acc.clone() } + } else { + acc.clone() } - None => acc.clone(), } + None => acc.clone(), }, ) } @@ -11063,28 +11063,28 @@ pub fn classify_body_provenance( ); Rc::new(v1_rt::map_keys(&recv_prov)).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, - pname: String| { - match v1_rt::map_get(&recv_prov, pname.clone()) { - Some(recv_rel) => { - let synth_field = Rc::new(InductiveField { - type_name: pname.clone(), - variant_name: "".to_string(), - field_name: mname.clone(), - shape: RecursionShape::ListRecursion, - element_type: pname.clone(), - }); - v1_rt::rc_map_insert( - acc.clone(), - pname.clone(), - compose_sub_value( - recv_rel.clone(), - synth_field.clone(), - ), - ) - } - None => acc.clone(), + |acc: _, pname: String| match v1_rt::map_get( + &recv_prov, + pname.clone(), + ) { + Some(recv_rel) => { + let synth_field = Rc::new(InductiveField { + type_name: pname.clone(), + variant_name: "".to_string(), + field_name: mname.clone(), + shape: RecursionShape::ListRecursion, + element_type: pname.clone(), + }); + v1_rt::rc_map_insert( + acc.clone(), + pname.clone(), + compose_sub_value( + recv_rel.clone(), + synth_field.clone(), + ), + ) } + None => acc.clone(), }, ) } @@ -11109,27 +11109,82 @@ pub fn classify_body_provenance( let mut __result = Vec::new(); for arm in arms.clone().iter().cloned() { __result.push({ - let arm_let_prov = match (*arm_pattern(arm.clone())).clone() { - MatchPattern::VariantPattern { name: vname, field_bindings: bindings, .. } => bindings.clone().iter().cloned().fold(let_prov.clone(), |acc: Rc>>>>, binding: Rc| { - let field_label = field_binding_name_at(binding.clone(), type_env.source_indices.clone()); -let bind_name = match (*field_binding_pattern(binding.clone())).clone() { - MatchPattern::Bind { declaration: declaration, .. } => declaration.name.clone(), - _ => "".to_string(), -}; -if ((bind_name.clone() != "".to_string()) && (field_label.clone() != "".to_string())) { - { - let field_prov = Rc::new(v1_rt::map_keys(&scrut_prov)).iter().cloned().fold(empty_prov_map(), |fp_acc: Rc>>, pname: String| maybe_insert_match_field_relation(fp_acc, pname.clone(), field_label.clone(), vname.clone(), v1_rt::map_get(&scrut_prov, pname.clone()), param_types.clone(), type_env.clone())); -v1_rt::rc_map_insert(acc.clone(), bind_name.clone(), field_prov.clone()) -} - } else { - acc.clone() - } -}), - MatchPattern::Bind { declaration: declaration, .. } => v1_rt::rc_map_insert(let_prov.clone(), declaration.name.clone(), scrut_prov.clone()), - _ => let_prov.clone(), -}; -classify_body_provenance(arm_body(arm.clone()), param_names.clone(), param_types.clone(), type_env.clone(), func_env.clone(), arm_let_prov.clone()) -}); + let arm_let_prov = match (*arm_pattern(arm.clone())).clone() { + MatchPattern::VariantPattern { + name: vname, + field_bindings: bindings, + .. + } => bindings.clone().iter().cloned().fold( + let_prov.clone(), + |acc: _, binding: Rc| { + let field_label = field_binding_name_at( + binding.clone(), + type_env.source_indices.clone(), + ); + let bind_name = + match (*field_binding_pattern(binding.clone())).clone() + { + MatchPattern::Bind { + declaration: declaration, + .. + } => declaration.name.clone(), + _ => "".to_string(), + }; + if ((bind_name.clone() != "".to_string()) + && (field_label.clone() != "".to_string())) + { + { + let field_prov = + Rc::new(v1_rt::map_keys(&scrut_prov)) + .iter() + .cloned() + .fold( + empty_prov_map(), + |fp_acc: _, pname: String| { + maybe_insert_match_field_relation( + fp_acc, + pname.clone(), + field_label.clone(), + vname.clone(), + v1_rt::map_get( + &scrut_prov, + pname.clone(), + ), + param_types.clone(), + type_env.clone(), + ) + }, + ); + v1_rt::rc_map_insert( + acc.clone(), + bind_name.clone(), + field_prov.clone(), + ) + } + } else { + acc.clone() + } + }, + ), + MatchPattern::Bind { + declaration: declaration, + .. + } => v1_rt::rc_map_insert( + let_prov.clone(), + declaration.name.clone(), + scrut_prov.clone(), + ), + _ => let_prov.clone(), + }; + classify_body_provenance( + arm_body(arm.clone()), + param_names.clone(), + param_types.clone(), + type_env.clone(), + func_env.clone(), + arm_let_prov.clone(), + ) + }); } __result }); @@ -11193,9 +11248,7 @@ classify_body_provenance(arm_body(arm.clone()), param_names.clone(), param_types prov: let_prov.clone(), last: empty_prov_map(), }), - |state: Rc, stmt: Rc| match (*stmt.expr_data.clone()) - .clone() - { + |state: _, stmt: Rc| match (*stmt.expr_data.clone()).clone() { ExprData::ExprLet => { let bname = let_binding_name_at(stmt.clone(), type_env.source_indices.clone()); @@ -11358,63 +11411,57 @@ pub fn compose_callee_provenance( Some(sig) => match sig.output_provenance.clone().first().cloned() { Some(callee_prov) => Rc::new(v1_rt::map_keys(&callee_prov)).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, callee_pname: String| { - match v1_rt::map_get(&callee_prov, callee_pname.clone()) { - Some(callee_rel) => { - match v1_rt::map_get(&arg_by_name, callee_pname.clone()) { - Some(arg) => { - let arg_prov = classify_body_provenance( - arg.clone(), - param_names.clone(), - param_types.clone(), - type_env.clone(), - func_env.clone(), - let_prov.clone(), - ); - Rc::new(v1_rt::map_keys(&arg_prov)).iter().cloned().fold( - acc.clone(), - |inner: Rc>>, - pname: String| { - match v1_rt::map_get(&arg_prov, pname.clone()) { - Some(arg_rel) => { - let composed = compose_sub_value_relations( - arg_rel.clone(), - callee_rel.clone(), - ); - match (*composed.clone()).clone() { - SubValueRelation::SubValueUnknown => { - inner.clone() - } - _ => match v1_rt::map_get( - &inner, - pname.clone(), - ) { - Some(existing) => v1_rt::rc_map_insert( - inner.clone(), - pname.clone(), - meet_sub_value( - existing.clone(), - composed.clone(), - ), - ), - None => v1_rt::rc_map_insert( - inner.clone(), - pname.clone(), - composed.clone(), - ), - }, - } - } - None => inner.clone(), - } - }, - ) - } - None => acc.clone(), - } + |acc: _, callee_pname: String| match v1_rt::map_get( + &callee_prov, + callee_pname.clone(), + ) { + Some(callee_rel) => match v1_rt::map_get(&arg_by_name, callee_pname.clone()) { + Some(arg) => { + let arg_prov = classify_body_provenance( + arg.clone(), + param_names.clone(), + param_types.clone(), + type_env.clone(), + func_env.clone(), + let_prov.clone(), + ); + Rc::new(v1_rt::map_keys(&arg_prov)).iter().cloned().fold( + acc.clone(), + |inner: _, pname: String| match v1_rt::map_get( + &arg_prov, + pname.clone(), + ) { + Some(arg_rel) => { + let composed = compose_sub_value_relations( + arg_rel.clone(), + callee_rel.clone(), + ); + match (*composed.clone()).clone() { + SubValueRelation::SubValueUnknown => inner.clone(), + _ => match v1_rt::map_get(&inner, pname.clone()) { + Some(existing) => v1_rt::rc_map_insert( + inner.clone(), + pname.clone(), + meet_sub_value( + existing.clone(), + composed.clone(), + ), + ), + None => v1_rt::rc_map_insert( + inner.clone(), + pname.clone(), + composed.clone(), + ), + }, + } + } + None => inner.clone(), + }, + ) } None => acc.clone(), - } + }, + None => acc.clone(), }, ), None => v1_rt::rc_empty_map::>(), @@ -11675,13 +11722,9 @@ pub fn meet_body_provenance_maps( ) .iter() .cloned() - .fold( - first_prov.clone(), - |acc: Rc>>, - prov: Rc>>| { - intersect_prov_maps(acc, prov.clone()) - }, - ), + .fold(first_prov.clone(), |acc: _, prov: _| { + intersect_prov_maps(acc, prov.clone()) + }), } } @@ -11689,23 +11732,23 @@ pub fn intersect_prov_maps( a: Rc>>, b: Rc>>, ) -> Rc>> { - Rc::new(v1_rt::map_keys(&a)).iter().cloned().fold( - empty_prov_map(), - |result: Rc>>, key: String| match v1_rt::map_get( - &b, - key.clone(), - ) { - Some(b_rel) => match v1_rt::map_get(&a, key.clone()) { - Some(a_rel) => v1_rt::rc_map_insert( - result.clone(), - key.clone(), - meet_sub_value(a_rel.clone(), b_rel.clone()), - ), + Rc::new(v1_rt::map_keys(&a)) + .iter() + .cloned() + .fold( + empty_prov_map(), + |result: _, key: String| match v1_rt::map_get(&b, key.clone()) { + Some(b_rel) => match v1_rt::map_get(&a, key.clone()) { + Some(a_rel) => v1_rt::rc_map_insert( + result.clone(), + key.clone(), + meet_sub_value(a_rel.clone(), b_rel.clone()), + ), + None => result.clone(), + }, None => result.clone(), }, - None => result.clone(), - }, - ) + ) } pub fn arm_ctx_from_variant_provenance( @@ -11723,79 +11766,82 @@ pub fn arm_ctx_from_variant_provenance( Some(variant_field_map) => { let call_args = call_args_by_name(scrut.clone(), ctx.type_env.clone().source_indices.clone()); - let extended = bindings.clone().iter().cloned().fold( - ctx.clone(), - |c: Rc, fb: Rc| { - let field_label = field_binding_name_at( - fb.clone(), - ctx.type_env.clone().source_indices.clone(), - ); - let bind_name = match (*field_binding_pattern(fb.clone())).clone() { - MatchPattern::Bind { - declaration: declaration, - .. - } => declaration.name.clone(), - _ => "".to_string(), - }; - if ((bind_name.clone() == "".to_string()) - || (field_label.clone() == "".to_string())) - { - c.clone() - } else { - match v1_rt::map_get(&variant_field_map, field_label.clone()) { - Some(param_map) => { - let composed = compose_callee_param_map( - param_map.clone(), - call_args.clone(), - c.param_order.clone(), - c.param_names.clone(), - c.type_env.clone(), - c.func_env.clone(), - v1_rt::rc_empty_map::< - String, - Rc>>, - >(), - ); - let all_rels = Rc::new({ - let mut __result = Vec::new(); - for k in Rc::new(v1_rt::map_keys(&composed)).iter().cloned() - { - __result.push( - match v1_rt::map_get(&composed, k.clone()) { - Some(r) => r.clone(), - None => { - Rc::new(SubValueRelation::SubValueUnknown) - } - }, - ); - } - __result - }); - let best = merge_argument_relations(all_rels.clone()); - match (*best.clone()).clone() { - SubValueRelation::SubValueUnknown => c.clone(), - _ => Rc::new(DescentContext { - fn_name: c.fn_name.clone(), - param_names: c.param_names.clone(), - param_order: c.param_order.clone(), - type_env: c.type_env.clone(), - sub_value_vars: v1_rt::rc_map_insert( - c.sub_value_vars.clone(), - bind_name.clone(), - best.clone(), - ), - size_aliases: c.size_aliases.clone(), - scope_locals: c.scope_locals.clone(), - func_env: c.func_env.clone(), - per_field_vars: c.per_field_vars.clone(), - }), - } - } - None => c.clone(), - } - } - }, - ); + let extended = + bindings + .clone() + .iter() + .cloned() + .fold(ctx.clone(), |c: _, fb: Rc| { + let field_label = field_binding_name_at( + fb.clone(), + ctx.type_env.clone().source_indices.clone(), + ); + let bind_name = match (*field_binding_pattern(fb.clone())).clone() { + MatchPattern::Bind { + declaration: declaration, + .. + } => declaration.name.clone(), + _ => "".to_string(), + }; + if ((bind_name.clone() == "".to_string()) + || (field_label.clone() == "".to_string())) + { + c.clone() + } else { + match v1_rt::map_get(&variant_field_map, field_label.clone()) { + Some(param_map) => { + let composed = compose_callee_param_map( + param_map.clone(), + call_args.clone(), + c.param_order.clone(), + c.param_names.clone(), + c.type_env.clone(), + c.func_env.clone(), + v1_rt::rc_empty_map::< + String, + Rc>>, + >(), + ); + let all_rels = Rc::new({ + let mut __result = Vec::new(); + for k in + Rc::new(v1_rt::map_keys(&composed)).iter().cloned() + { + __result.push( + match v1_rt::map_get(&composed, k.clone()) { + Some(r) => r.clone(), + None => Rc::new( + SubValueRelation::SubValueUnknown, + ), + }, + ); + } + __result + }); + let best = merge_argument_relations(all_rels.clone()); + match (*best.clone()).clone() { + SubValueRelation::SubValueUnknown => c.clone(), + _ => Rc::new(DescentContext { + fn_name: c.fn_name.clone(), + param_names: c.param_names.clone(), + param_order: c.param_order.clone(), + type_env: c.type_env.clone(), + sub_value_vars: v1_rt::rc_map_insert( + c.sub_value_vars.clone(), + bind_name.clone(), + best.clone(), + ), + size_aliases: c.size_aliases.clone(), + scope_locals: c.scope_locals.clone(), + func_env: c.func_env.clone(), + per_field_vars: c.per_field_vars.clone(), + }), + } + } + None => c.clone(), + } + } + }); Some(extended.clone()) } None => None, @@ -11815,10 +11861,7 @@ pub fn compose_callee_param_map( ) -> Rc>> { Rc::new(v1_rt::map_keys(&callee_prov)).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, callee_pname: String| match v1_rt::map_get( - &callee_prov, - callee_pname.clone(), - ) { + |acc: _, callee_pname: String| match v1_rt::map_get(&callee_prov, callee_pname.clone()) { Some(callee_rel) => match v1_rt::map_get(&arg_by_name, callee_pname.clone()) { Some(arg) => { let arg_prov = classify_body_provenance( @@ -11831,24 +11874,22 @@ pub fn compose_callee_param_map( ); Rc::new(v1_rt::map_keys(&arg_prov)).iter().cloned().fold( acc.clone(), - |inner: Rc>>, pname: String| { - match v1_rt::map_get(&arg_prov, pname.clone()) { - Some(arg_rel) => { - let composed = compose_sub_value_relations( - arg_rel.clone(), - callee_rel.clone(), - ); - match (*composed.clone()).clone() { - SubValueRelation::SubValueUnknown => inner.clone(), - _ => v1_rt::rc_map_insert( - inner.clone(), - pname.clone(), - composed.clone(), - ), - } + |inner: _, pname: String| match v1_rt::map_get(&arg_prov, pname.clone()) { + Some(arg_rel) => { + let composed = compose_sub_value_relations( + arg_rel.clone(), + callee_rel.clone(), + ); + match (*composed.clone()).clone() { + SubValueRelation::SubValueUnknown => inner.clone(), + _ => v1_rt::rc_map_insert( + inner.clone(), + pname.clone(), + composed.clone(), + ), } - None => inner.clone(), } + None => inner.clone(), }, ) } @@ -11956,10 +11997,7 @@ pub fn collect_variant_constructors( String, Rc>>, >(), - |m: Rc< - HashMap>>>, - >, - fi: Rc| { + |m: _, fi: Rc| { let fname = field_init_node_name_at( fi.clone(), type_env.source_indices.clone(), @@ -12029,30 +12067,98 @@ pub fn collect_variant_constructors( body.clone(), type_env.source_indices.clone(), ); - Rc::new(v1_rt::map_keys(&sig.variant_provenance.clone())).iter().cloned().fold(acc.clone(), |variant_acc: Rc>>>>>>, variant_name: String| match v1_rt::map_get(&sig.variant_provenance.clone(), variant_name.clone()) { - Some(field_map) => { - let composed_field_map = Rc::new(v1_rt::map_keys(&field_map)).iter().cloned().fold(v1_rt::rc_empty_map::>>>(), |fm_acc: Rc>>>>, field_name: String| match v1_rt::map_get(&field_map, field_name.clone()) { - Some(param_map) => { - let composed = compose_callee_param_map(param_map.clone(), call_args.clone(), param_names.clone(), param_types.clone(), type_env.clone(), func_env.clone(), let_prov.clone()); -if ((Rc::new(v1_rt::map_keys(&composed)).len() as i64) > 0) { - v1_rt::rc_map_insert(fm_acc.clone(), field_name.clone(), composed.clone()) - } else { - fm_acc.clone() - } -}, - None => fm_acc.clone(), -}); -if ((Rc::new(v1_rt::map_keys(&composed_field_map)).len() as i64) > 0) { - match v1_rt::map_get(&variant_acc, variant_name.clone()) { - Some(existing) => v1_rt::rc_map_insert(variant_acc.clone(), variant_name.clone(), merge_field_prov_maps(existing.clone(), composed_field_map.clone())), - None => v1_rt::rc_map_insert(variant_acc.clone(), variant_name.clone(), composed_field_map.clone()), -} - } else { - variant_acc.clone() - } -}, - None => variant_acc.clone(), -}) + Rc::new(v1_rt::map_keys(&sig.variant_provenance.clone())) + .iter() + .cloned() + .fold(acc.clone(), |variant_acc: _, variant_name: String| { + match v1_rt::map_get( + &sig.variant_provenance.clone(), + variant_name.clone(), + ) { + Some(field_map) => { + let composed_field_map = + Rc::new(v1_rt::map_keys(&field_map)) + .iter() + .cloned() + .fold( + v1_rt::rc_empty_map::< + String, + Rc< + HashMap< + String, + Rc, + >, + >, + >( + ), + |fm_acc: _, field_name: String| { + match v1_rt::map_get( + &field_map, + field_name.clone(), + ) { + Some(param_map) => { + let composed = + compose_callee_param_map( + param_map.clone(), + call_args.clone(), + param_names.clone(), + param_types.clone(), + type_env.clone(), + func_env.clone(), + let_prov.clone(), + ); + if ((Rc::new( + v1_rt::map_keys( + &composed, + ), + ) + .len() + as i64) + > 0) + { + v1_rt::rc_map_insert( + fm_acc.clone(), + field_name.clone(), + composed.clone(), + ) + } else { + fm_acc.clone() + } + } + None => fm_acc.clone(), + } + }, + ); + if ((Rc::new(v1_rt::map_keys(&composed_field_map)) + .len() + as i64) + > 0) + { + match v1_rt::map_get( + &variant_acc, + variant_name.clone(), + ) { + Some(existing) => v1_rt::rc_map_insert( + variant_acc.clone(), + variant_name.clone(), + merge_field_prov_maps( + existing.clone(), + composed_field_map.clone(), + ), + ), + None => v1_rt::rc_map_insert( + variant_acc.clone(), + variant_name.clone(), + composed_field_map.clone(), + ), + } + } else { + variant_acc.clone() + } + } + None => variant_acc.clone(), + } + }) } } else { acc.clone() @@ -12063,10 +12169,7 @@ if ((Rc::new(v1_rt::map_keys(&composed_field_map)).len() as i64) > 0) { } ExprData::ExprMatch => match_arm_nodes(body.clone()).iter().cloned().fold( acc.clone(), - |a: Rc< - HashMap>>>>>, - >, - arm: Rc| { + |a: _, arm: Rc| { collect_variant_constructors( arm_body(arm.clone()), parent_enum.clone(), @@ -12147,14 +12250,8 @@ if ((Rc::new(v1_rt::map_keys(&composed_field_map)).len() as i64) > 0) { ) .iter() .cloned() - .fold( - let_prov.clone(), - |lp: Rc>>>>, - stmt: Rc| match (*stmt - .expr_data - .clone()) - .clone() - { + .fold(let_prov.clone(), |lp: _, stmt: Rc| { + match (*stmt.expr_data.clone()).clone() { ExprData::ExprLet => { let bname = let_binding_name_at( stmt.clone(), @@ -12171,8 +12268,8 @@ if ((Rc::new(v1_rt::map_keys(&composed_field_map)).len() as i64) > 0) { v1_rt::rc_map_insert(lp.clone(), bname.clone(), vprov.clone()) } _ => lp.clone(), - }, - ); + } + }); match stmts .clone() .iter() @@ -12207,8 +12304,7 @@ pub fn merge_field_prov_maps( { let from_a = Rc::new(v1_rt::map_keys(&a)).iter().cloned().fold( v1_rt::rc_empty_map::>>>(), - |result: Rc>>>>, - fname: String| match v1_rt::map_get(&a, fname.clone()) { + |result: _, fname: String| match v1_rt::map_get(&a, fname.clone()) { Some(a_prov) => match v1_rt::map_get(&b, fname.clone()) { Some(b_prov) => v1_rt::rc_map_insert( result.clone(), @@ -12222,8 +12318,7 @@ pub fn merge_field_prov_maps( ); Rc::new(v1_rt::map_keys(&b)).iter().cloned().fold( from_a.clone(), - |result: Rc>>>>, - fname: String| { + |result: _, fname: String| { if (v1_rt::map_get(&result, fname.clone()) != None) { result.clone() } else { @@ -12246,10 +12341,7 @@ pub fn union_prov_maps( { let from_a = Rc::new(v1_rt::map_keys(&a)).iter().cloned().fold( empty_prov_map(), - |result: Rc>>, key: String| match v1_rt::map_get( - &a, - key.clone(), - ) { + |result: _, key: String| match v1_rt::map_get(&a, key.clone()) { Some(a_rel) => match v1_rt::map_get(&b, key.clone()) { Some(b_rel) => v1_rt::rc_map_insert( result.clone(), @@ -12263,7 +12355,7 @@ pub fn union_prov_maps( ); Rc::new(v1_rt::map_keys(&b)).iter().cloned().fold( from_a.clone(), - |result: Rc>>, key: String| { + |result: _, key: String| { if (v1_rt::map_get(&result, key.clone()) != None) { result.clone() } else { @@ -12288,7 +12380,7 @@ pub fn populate_output_provenance( { let updated_local = typed_items.clone().iter().cloned().fold( func_env.local.clone(), - |acc: Rc>>, item: Rc| { + |acc: _, item: Rc| { if ((item.params.clone().len() as i64) > 0) { { let fn_name = @@ -12752,7 +12844,7 @@ pub fn infer_item(item: Rc, scope: Rc) -> Rc let fn_scope = build_params_scope(scope.clone(), item.params.clone()); let fn_scope = item.uses.clone().iter().cloned().fold( fn_scope.clone(), - |s: Rc, u: Rc| { + |s: _, u: Rc| { extend_scope( s, resource_use_name_at( @@ -13544,13 +13636,11 @@ pub fn type_env_cache_from_bindings( { let str_bindings = Rc::new(v1_rt::map_values(&bindings)).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, b: Rc| { - v1_rt::rc_map_insert(acc, b.name.clone(), b.clone()) - }, + |acc: _, b: _| v1_rt::rc_map_insert(acc, b.name.clone(), b.clone()), ); let deps_map = Rc::new(v1_rt::map_values(&bindings)).iter().cloned().fold( v1_rt::rc_empty_map::>>(), - |acc: Rc>>>, b: Rc| { + |acc: Rc>>>, b: _| { v1_rt::rc_map_insert( acc, b.name.clone(), @@ -13615,7 +13705,7 @@ pub fn union_parent_type_env_caches( cache: head.cache.clone(), conflicts: Rc::new(vec![]), }), - |acc: Rc, row: Rc| { + |acc: _, row: _| { merge_type_env_cache_guarded( acc.cache.clone(), row.cache.clone(), @@ -13646,7 +13736,7 @@ pub fn kernel_coproduct_variant_locals(env: Rc) -> Rc>(), - |acc: Rc>>, binding: Rc| { + |acc: _, binding: _| { let is_coproduct = (binding.resolved.clone().connective.clone() == Connective::Disj); if is_coproduct.clone() { @@ -13657,25 +13747,22 @@ pub fn kernel_coproduct_variant_locals(env: Rc) -> Rc>>, child: Rc| { - let child_name = - authored_name_at(env.source_indices.clone(), child.clone()); - match v1_rt::map_get(&vacc, child_name.clone()) { - Some(_prev) => vacc.clone(), - None => v1_rt::rc_map_insert( - vacc.clone(), - child_name.clone(), - Rc::new(TypeBinding { - name: child_name.clone(), - resolved: binding.resolved.clone(), - provenance: Rc::new(SubValueRelation::SubValueUnknown), - }), - ), - } - }, - ) + .fold(acc.clone(), |vacc: _, child: Rc| { + let child_name = + authored_name_at(env.source_indices.clone(), child.clone()); + match v1_rt::map_get(&vacc, child_name.clone()) { + Some(_prev) => vacc.clone(), + None => v1_rt::rc_map_insert( + vacc.clone(), + child_name.clone(), + Rc::new(TypeBinding { + name: child_name.clone(), + resolved: binding.resolved.clone(), + provenance: Rc::new(SubValueRelation::SubValueUnknown), + }), + ), + } + }) } else { acc.clone() } @@ -13696,18 +13783,14 @@ pub fn merge_kernel_variant_locals_low_priority( .cloned() .fold( locals.clone(), - |acc: Rc>>, variant_name: String| { - match v1_rt::map_get(&acc, variant_name.clone()) { - Some(_) => acc.clone(), - None => match v1_rt::map_get(&kernel_locals, variant_name.clone()) { - Some(binding) => v1_rt::rc_map_insert( - acc.clone(), - variant_name.clone(), - binding.clone(), - ), - None => acc.clone(), - }, - } + |acc: _, variant_name: String| match v1_rt::map_get(&acc, variant_name.clone()) { + Some(_) => acc.clone(), + None => match v1_rt::map_get(&kernel_locals, variant_name.clone()) { + Some(binding) => { + v1_rt::rc_map_insert(acc.clone(), variant_name.clone(), binding.clone()) + } + None => acc.clone(), + }, }, ) } @@ -13721,7 +13804,7 @@ pub fn type_env_for_import(module_path: String, parent_env: Rc) -> Rc>(), - |acc: Rc>>, ident: i64| { + |acc: _, ident: i64| { let name = intern_str(parent_env.intern_table.clone(), ident.clone()); if is_type_variable_name(name.clone()) { acc.clone() @@ -13742,7 +13825,7 @@ pub fn type_env_for_import(module_path: String, parent_env: Rc) -> Rc>(), - |acc: Rc>>, name: String| { + |acc: _, name: String| { if is_type_variable_name(name.clone()) { acc.clone() } else { @@ -13761,7 +13844,7 @@ pub fn type_env_for_import(module_path: String, parent_env: Rc) -> Rc>(), - |acc: Rc>>, name: String| { + |acc: _, name: String| { if is_type_variable_name(name.clone()) { acc.clone() } else { @@ -14339,12 +14422,11 @@ pub fn symbol_index_insert_unique_disj_variant_aliases( .clone() .iter() .cloned() - .fold( - index.clone(), - |acc: Rc, item: Rc| match item.connective.clone() { + .fold(index.clone(), |acc: _, item: Rc| { + match item.connective.clone() { Connective::Disj => item.children.clone().iter().cloned().fold( acc.clone(), - |a2: Rc, child: Rc| { + |a2: _, child: Rc| { let vname = authored_name_at(source_indices.clone(), child.clone()); match v1_rt::map_get(&counts, vname.clone()) { Some(1) => { @@ -14396,8 +14478,8 @@ pub fn symbol_index_insert_unique_disj_variant_aliases( }, ), _ => acc.clone(), - }, - ) + } + }) } } @@ -14412,20 +14494,22 @@ pub fn build_symbol_index_census_raw_nodes( corpus_item_name_counts_nodes(module_nodes.clone(), source_indices.clone()); module_nodes.clone().iter().cloned().fold( empty_symbol_index(), - |index: Rc, module_node: Rc| { + |index: _, module_node: Rc| { let module_path = authored_name_at(source_indices.clone(), module_node.clone()); let items = module_items(module_node.clone()); - let with_items = items.clone().iter().cloned().fold( - index, - |acc: Rc, item: Rc| { - symbol_index_insert_item( - acc, - module_path.clone(), - item.clone(), - source_indices.clone(), - ) - }, - ); + let with_items = + items + .clone() + .iter() + .cloned() + .fold(index, |acc: _, item: Rc| { + symbol_index_insert_item( + acc, + module_path.clone(), + item.clone(), + source_indices.clone(), + ) + }); symbol_index_insert_unique_disj_variant_aliases( with_items.clone(), module_path.clone(), @@ -14936,12 +15020,9 @@ pub fn census_with_resolved_fn_sigs( let bare_keys = Rc::new(v1_rt::sorted_map_keys(&index.global_bare.clone())); let global2 = bare_keys.clone().iter().cloned().fold( index.global_bare.clone(), - |acc: Rc>>, k: String| match v1_rt::map_get( - &index.global_bare.clone(), - k.clone(), - ) - .as_deref() - .cloned() + |acc: _, k: String| match v1_rt::map_get(&index.global_bare.clone(), k.clone()) + .as_deref() + .cloned() { Some(GlobalBareLookupState::GlobalBareUniqueBinding { module_path: mp, @@ -15072,10 +15153,7 @@ pub fn symbol_index_with_bare_fill( let bare_keys = Rc::new(v1_rt::sorted_map_keys(&tree.global_bare.clone())); let global2 = bare_keys.clone().iter().cloned().fold( closure.global_bare.clone(), - |acc: Rc>>, k: String| match v1_rt::map_get( - &acc, - k.clone(), - ) { + |acc: _, k: String| match v1_rt::map_get(&acc, k.clone()) { Some(_) => acc.clone(), None => match v1_rt::map_get(&tree.global_bare.clone(), k.clone()) { Some(state) => v1_rt::rc_map_insert(acc.clone(), k.clone(), state.clone()), @@ -15110,54 +15188,61 @@ pub fn build_symbol_index_qualified_fill( source_indices: Rc>>, ) -> Rc { { - let raw = modules.clone().iter().cloned().fold( - empty_symbol_index(), - |index: Rc, module_node: Rc| { - let module_path = authored_name_at(source_indices.clone(), module_node.clone()); - let items = module_items(module_node.clone()); - let with_items = items.clone().iter().cloned().fold( - index, - |acc: Rc, item: Rc| match local_binding_for_item( - item.clone(), - source_indices.clone(), - ) { - None => acc.clone(), - Some(binding) => symbol_index_insert( - acc.clone(), - v1_rt::concat( - v1_rt::concat(module_path.clone(), ".".to_string()), - binding.name.clone(), - ), - binding.resolved.clone(), - ), - }, - ); - let counts = disj_variant_name_counts(items.clone(), source_indices.clone()); - items.clone().iter().cloned().fold( - with_items.clone(), - |acc: Rc, item: Rc| match item.connective.clone() { - Connective::Disj => item.children.clone().iter().cloned().fold( - acc.clone(), - |a2: Rc, child: Rc| { - let vname = authored_name_at(source_indices.clone(), child.clone()); - match v1_rt::map_get(&counts, vname.clone()) { - Some(1) => symbol_index_insert( - a2.clone(), + let raw = + modules.clone().iter().cloned().fold( + empty_symbol_index(), + |index: _, module_node: Rc| { + let module_path = authored_name_at(source_indices.clone(), module_node.clone()); + let items = module_items(module_node.clone()); + let with_items = + items + .clone() + .iter() + .cloned() + .fold( + index, + |acc: _, item: Rc| match local_binding_for_item( + item.clone(), + source_indices.clone(), + ) { + None => acc.clone(), + Some(binding) => symbol_index_insert( + acc.clone(), v1_rt::concat( v1_rt::concat(module_path.clone(), ".".to_string()), - vname.clone(), + binding.name.clone(), ), - item.clone(), + binding.resolved.clone(), ), - _ => a2.clone(), - } - }, - ), - _ => acc.clone(), - }, - ) - }, - ); + }, + ); + let counts = disj_variant_name_counts(items.clone(), source_indices.clone()); + items.clone().iter().cloned().fold( + with_items.clone(), + |acc: _, item: Rc| match item.connective.clone() { + Connective::Disj => item.children.clone().iter().cloned().fold( + acc.clone(), + |a2: _, child: Rc| { + let vname = + authored_name_at(source_indices.clone(), child.clone()); + match v1_rt::map_get(&counts, vname.clone()) { + Some(1) => symbol_index_insert( + a2.clone(), + v1_rt::concat( + v1_rt::concat(module_path.clone(), ".".to_string()), + vname.clone(), + ), + item.clone(), + ), + _ => a2.clone(), + } + }, + ), + _ => acc.clone(), + }, + ) + }, + ); census_with_resolved_fn_sigs(raw.clone(), source_indices.clone()) } } @@ -15210,7 +15295,7 @@ pub fn overlay_direct_import_exports( ) -> Rc>> { resolved_imports.clone().iter().cloned().fold( ancestry_str_bindings.clone(), - |acc: Rc>>, imp: Rc| match v1_rt::map_get( + |acc: _, imp: Rc| match v1_rt::map_get( &parent_index, imp.module_path.clone(), ) { @@ -15235,9 +15320,11 @@ pub fn overlay_direct_import_exports( } else { imp.specific_names.clone() }; - selected.clone().iter().cloned().fold( - acc.clone(), - |bacc: Rc>>, name: String| { + selected + .clone() + .iter() + .cloned() + .fold(acc.clone(), |bacc: _, name: String| { if overlay_skips_kernel_name(name.clone()) { bacc.clone() } else { @@ -15251,8 +15338,7 @@ pub fn overlay_direct_import_exports( None => bacc.clone(), } } - }, - ) + }) } None => acc.clone(), }, @@ -15323,7 +15409,7 @@ pub fn build_type_env( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, name: String| { + |acc: _, name: String| { v1_rt::rc_map_insert( acc, intern(intern_table.clone(), name.clone()).id.clone(), @@ -15598,7 +15684,7 @@ pub fn build_type_env( }); let local_bindings = module_items(module.module.clone()).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, item: Rc| { + |acc: _, item: Rc| { if is_namespace_alias_item(item.clone(), source_indices.clone()) { match namespace_alias_target_path(item.clone(), source_indices.clone()) { None => acc.clone(), @@ -15638,7 +15724,7 @@ pub fn build_type_env( ); let param_bindings = module_items(module.module.clone()).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, item: Rc| { + |acc: _, item: Rc| { let is_type_decl = match v1_rt::map_get( &local_bindings, intern( @@ -15657,7 +15743,7 @@ pub fn build_type_env( { let result = item.params.clone().iter().cloned().fold( acc.clone(), - |pacc: Rc>>, p: Rc| { + |pacc: _, p: Rc| { v1_rt::rc_map_insert( pacc, intern( @@ -15710,7 +15796,7 @@ pub fn build_type_env( .cloned() .fold( v1_rt::rc_empty_map::>>(), - |acc: Rc>>>, b: Rc| { + |acc: Rc>>>, b: _| { v1_rt::rc_map_insert( acc, b.name.clone(), @@ -15723,9 +15809,7 @@ pub fn build_type_env( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, b: Rc| { - v1_rt::rc_map_insert(acc, b.name.clone(), b.clone()) - }, + |acc: _, b: _| v1_rt::rc_map_insert(acc, b.name.clone(), b.clone()), ); let all_deps_map = v1_rt::rc_map_merge(ancestry_cache.deps_map.clone(), local_deps_map.clone()); @@ -15791,7 +15875,7 @@ pub fn build_type_env( .cloned() .fold( head_parent.inductive_fields.clone(), - |acc: Rc>>>>, parent: Rc| { + |acc: _, parent: Rc| { merge_inductive_fields(acc, parent.inductive_fields.clone()) }, ), @@ -15960,7 +16044,7 @@ pub fn build_type_env_unresolved( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, name: String| { + |acc: _, name: String| { v1_rt::rc_map_insert( acc, intern(intern_table.clone(), name.clone()).id.clone(), @@ -16119,7 +16203,7 @@ pub fn build_type_env_unresolved( let scope_parents = v1_rt::concat(import_parents.clone(), Rc::new(vec![kernel.clone()])); let local_bindings = module_items(module.module.clone()).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, item: Rc| { + |acc: _, item: Rc| { if is_namespace_alias_item(item.clone(), source_indices.clone()) { acc.clone() } else { @@ -16274,7 +16358,7 @@ pub fn build_type_env_unresolved( .cloned() .fold( v1_rt::rc_empty_map::>>(), - |acc: Rc>>>, b: Rc| { + |acc: Rc>>>, b: _| { v1_rt::rc_map_insert( acc, b.name.clone(), @@ -16287,9 +16371,7 @@ pub fn build_type_env_unresolved( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, b: Rc| { - v1_rt::rc_map_insert(acc, b.name.clone(), b.clone()) - }, + |acc: _, b: _| v1_rt::rc_map_insert(acc, b.name.clone(), b.clone()), ); let all_deps_map = v1_rt::rc_map_merge(ancestry_cache.deps_map.clone(), local_deps_map.clone()); @@ -16355,7 +16437,7 @@ pub fn build_type_env_unresolved( .cloned() .fold( head_parent.inductive_fields.clone(), - |acc: Rc>>>>, parent: Rc| { + |acc: _, parent: Rc| { merge_inductive_fields(acc, parent.inductive_fields.clone()) }, ), @@ -16697,9 +16779,11 @@ pub fn bind_coproduct_item_arms( source_indices: Rc>>, module_name: String, ) -> Rc { - item.children.clone().iter().cloned().fold( - state.clone(), - |vacc: Rc, child: Rc| { + item.children + .clone() + .iter() + .cloned() + .fold(state.clone(), |vacc: _, child: Rc| { insert_variant_owner_checked( vacc, authored_name_at(source_indices.clone(), child.clone()), @@ -16707,8 +16791,7 @@ pub fn bind_coproduct_item_arms( source_indices.clone(), module_name.clone(), ) - }, - ) + }) } pub fn build_local_variants( @@ -16721,7 +16804,7 @@ pub fn build_local_variants( .clone() .iter() .cloned() - .fold(init.clone(), |acc: Rc, item: Rc| { + .fold(init.clone(), |acc: _, item: Rc| { let item_is_coproduct = (item.connective.clone() == Connective::Disj); if item_is_coproduct.clone() { bind_coproduct_item_arms( @@ -16770,12 +16853,9 @@ pub fn build_global_bare_variant_locals( ) -> Rc>> { Rc::new(v1_rt::map_keys(&global_bare)).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, name: String| match v1_rt::map_get( - &global_bare, - name.clone(), - ) - .as_deref() - .cloned() + |acc: _, name: String| match v1_rt::map_get(&global_bare, name.clone()) + .as_deref() + .cloned() { Some(GlobalBareLookupState::GlobalBareUniqueBinding { binding, .. }) => { let owner = binding.resolved.clone(); @@ -17002,7 +17082,7 @@ pub fn build_imported_variants( ) -> Rc { resolved_imports.clone().iter().cloned().fold( init.clone(), - |acc: Rc, imp: Rc| { + |acc: _, imp: Rc| { let with_glob = if imp.is_all.clone() { { let source_items = match v1_rt::map_get(&parent_index, imp.module_path.clone()) @@ -17012,7 +17092,7 @@ pub fn build_imported_variants( }; source_items.clone().iter().cloned().fold( acc.clone(), - |iacc: Rc, item: Rc| { + |iacc: _, item: Rc| { let item_is_coproduct = (item.connective.clone() == Connective::Disj); if item_is_coproduct.clone() { bind_coproduct_item_arms( @@ -17032,7 +17112,7 @@ pub fn build_imported_variants( }; imp.specific_names.clone().iter().cloned().fold( with_glob.clone(), - |nacc: Rc, name: String| { + |nacc: _, name: String| { let surface = match v1_rt::map_get(&variant_surfaces, imp.module_path.clone()) { Some(s) => s.clone(), None => empty_variant_export_surface(), @@ -17101,7 +17181,7 @@ pub fn build_module_context( svc_registry: v1_rt::rc_empty_map::>>>(), svc_locals: v1_rt::rc_empty_map::>(), }), - |acc: Rc, sname: String| match v1_rt::map_get( + |acc: _, sname: String| match v1_rt::map_get( &env.symbol_index.clone().services.clone(), sname.clone(), ) { @@ -17182,12 +17262,9 @@ pub fn build_module_context( let all_locals = Rc::new(v1_rt::map_values(&merged_scope.svc_locals.clone())) .iter() .cloned() - .fold( - env_variant_locals.clone(), - |acc: Rc>>, binding: Rc| { - v1_rt::rc_map_insert(acc, binding.name.clone(), binding.clone()) - }, - ); + .fold(env_variant_locals.clone(), |acc: _, binding: _| { + v1_rt::rc_map_insert(acc, binding.name.clone(), binding.clone()) + }); Rc::new(ModuleContext { resolved_items: local.resolved_items.clone(), func_env: resolve_result.func_env.clone(), @@ -17299,7 +17376,7 @@ pub fn typecheck_module( ); let data_locals = ctx.resolved_items.clone().iter().cloned().fold( ctx.locals.clone(), - |acc: Rc>>, item: Rc| { + |acc: _, item: Rc| { if ((((item.body.clone() != None) && ((item.params.clone().len() as i64) == 0)) && (item.inferred.clone() == None)) && (item.type_annotation.clone() != None)) @@ -17574,7 +17651,7 @@ pub fn topo_resolve_types( str_bindings: env.str_bindings.clone(), diagnostics: Rc::new(vec![]), }), - |acc: Rc, name: String| { + |acc: _, name: String| { let ident = intern(env.intern_table.clone(), name.clone()).id.clone(); match v1_rt::map_get(&env.bindings.clone(), ident.clone()) { Some(binding) => { @@ -17641,7 +17718,7 @@ pub fn topo_resolve_types( str_bindings: env.str_bindings.clone(), diagnostics: Rc::new(vec![]), }), - |acc: Rc, name: String| { + |acc: _, name: String| { let ident = intern(env.intern_table.clone(), name.clone()).id.clone(); match v1_rt::map_get(&env.bindings.clone(), ident.clone()) { Some(binding) => { @@ -17798,63 +17875,70 @@ pub fn build_fielded_variants( type_summaries: Rc>>, ) -> Rc> { { - let result = modules.clone().iter().cloned().fold( - v1_rt::rc_empty_set::<_>(), - |acc: _, m: Rc| { - let items = m.items.clone(); - let si = m.type_env.clone().source_indices.clone(); - items - .clone() - .iter() - .cloned() - .fold(acc, |inner: _, item: Rc| { - let is_enum = match v1_rt::map_get( - &type_summaries, - authored_name_at(si.clone(), item.clone()), - ) { - Some(summary) => match (*summary.repr.clone()).clone() { - TypeRepr::EnumRepr { unit_only: _, .. } => true, - _ => false, - }, - None => false, - }; - if is_enum.clone() { - { - let enum_name = authored_name_at(si.clone(), item.clone()); - let variants = item.children.clone(); - variants.clone().iter().cloned().fold( - inner.clone(), - |vacc: _, variant: Rc| { - let has_fields = - ((variant.children.clone().len() as i64) > 0); - let is_positional_payload = - variant_has_positional_payload_shape( - variant.clone(), - si.clone(), - ); - if (has_fields.clone() && !is_positional_payload.clone()) { - v1_rt::rc_set_insert( - vacc.clone(), - v1_rt::concat( + let result = + modules + .clone() + .iter() + .cloned() + .fold(v1_rt::rc_empty_set::<_>(), |acc: _, m: _| { + let items = m.items.clone(); + let si = m.type_env.clone().source_indices.clone(); + items + .clone() + .iter() + .cloned() + .fold(acc, |inner: _, item: Rc| { + let is_enum = match v1_rt::map_get( + &type_summaries, + authored_name_at(si.clone(), item.clone()), + ) { + Some(summary) => match (*summary.repr.clone()).clone() { + TypeRepr::EnumRepr { unit_only: _, .. } => true, + _ => false, + }, + None => false, + }; + if is_enum.clone() { + { + let enum_name = authored_name_at(si.clone(), item.clone()); + let variants = item.children.clone(); + variants.clone().iter().cloned().fold( + inner.clone(), + |vacc: _, variant: Rc| { + let has_fields = + ((variant.children.clone().len() as i64) > 0); + let is_positional_payload = + variant_has_positional_payload_shape( + variant.clone(), + si.clone(), + ); + if (has_fields.clone() + && !is_positional_payload.clone()) + { + v1_rt::rc_set_insert( + vacc.clone(), v1_rt::concat( - enum_name.clone(), - "::".to_string(), + v1_rt::concat( + enum_name.clone(), + "::".to_string(), + ), + authored_name_at( + si.clone(), + variant.clone(), + ), ), - authored_name_at(si.clone(), variant.clone()), - ), - ) - } else { - vacc.clone() - } - }, - ) + ) + } else { + vacc.clone() + } + }, + ) + } + } else { + inner.clone() } - } else { - inner.clone() - } - }) - }, - ); + }) + }); result } } @@ -17865,7 +17949,7 @@ pub fn build_positional_payload_variants( ) -> Rc> { modules.clone().iter().cloned().fold( v1_rt::rc_empty_set::(), - |acc: Rc>, m: Rc| { + |acc: Rc>, m: _| { let items = m.items.clone(); let si = m.type_env.clone().source_indices.clone(); items.clone().iter().cloned().fold( @@ -17958,41 +18042,45 @@ pub fn build_emit_graph_info( type_summaries: v1_rt::rc_empty_map::>(), type_decl_items: v1_rt::rc_empty_map::>(), }); - let built_raw = modules.clone().iter().cloned().fold( - init.clone(), - |state: Rc, typed_module: Rc| { - typed_module.items.clone().iter().cloned().fold( - state, - |inner_state: Rc, item: Rc| { - add_emit_item_summary( - inner_state, - item.clone(), - typed_module.type_env.clone().source_indices.clone(), - ) - }, - ) - }, - ); + let built_raw = + modules + .clone() + .iter() + .cloned() + .fold(init.clone(), |state: _, typed_module: _| { + typed_module.items.clone().iter().cloned().fold( + state, + |inner_state: _, item: Rc| { + add_emit_item_summary( + inner_state, + item.clone(), + typed_module.type_env.clone().source_indices.clone(), + ) + }, + ) + }); let built = Rc::new(EmitInfoBuildState { type_summaries: close_fn_fields(built_raw.type_summaries.clone()), type_decl_items: built_raw.type_decl_items.clone(), }); - let all_recursive = modules.clone().iter().cloned().fold( - v1_rt::rc_empty_set::<_>(), - |acc: _, m: Rc| { - Rc::new(v1_rt::map_keys( - &m.type_env.clone().recursive_type_set.clone(), - )) + let all_recursive = + modules + .clone() .iter() .cloned() - .fold(acc, |inner: _, ident: i64| { - v1_rt::rc_set_insert( - inner, - intern_str(m.type_env.clone().intern_table.clone(), ident.clone()), - ) - }) - }, - ); + .fold(v1_rt::rc_empty_set::<_>(), |acc: _, m: _| { + Rc::new(v1_rt::map_keys( + &m.type_env.clone().recursive_type_set.clone(), + )) + .iter() + .cloned() + .fold(acc, |inner: _, ident: i64| { + v1_rt::rc_set_insert( + inner, + intern_str(m.type_env.clone().intern_table.clone(), ident.clone()), + ) + }) + }); let fielded = build_fielded_variants(modules.clone(), built.type_summaries.clone()); let positional = build_positional_payload_variants(modules.clone(), built.type_summaries.clone()); @@ -18103,7 +18191,7 @@ pub fn typecheck_with_census_extra( item_registry: v1_rt::rc_empty_map::>(), diags_by_name: v1_rt::rc_empty_map::>>>(), }), - |st: Rc, rm: Rc| { + |st: _, rm: Rc| { realize_module( authored_name_at(source_indices.clone(), rm.module.clone()), resolved_by_name.clone(), @@ -18180,7 +18268,7 @@ pub fn realize_module( Some(resolved) => { let dep_state = resolved.resolved_imports.clone().iter().cloned().fold( state, - |st: Rc, imp: Rc| { + |st: _, imp: Rc| { realize_module( imp.module_path.clone(), resolved_by_name.clone(), @@ -18282,7 +18370,7 @@ pub fn export_index_merge_module( index: acc.clone(), seen_names: v1_rt::rc_empty_set::(), }), - |state: Rc, binding: Rc| { + |state: _, binding: _| { let name = binding.name.clone(); if v1_rt::set_contains(&state.seen_names.clone(), name.clone()) { state.clone() @@ -18326,9 +18414,7 @@ pub fn build_type_name_export_index( ) -> Rc>> { modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, m: Rc| { - export_index_merge_module(acc, m.clone()) - }, + |acc: _, m: _| export_index_merge_module(acc, m.clone()), ) } @@ -18347,9 +18433,7 @@ pub fn module_exported_type_names(m: Rc) -> Rc> { .cloned() .fold( v1_rt::rc_empty_set::(), - |acc: Rc>, b: Rc| { - v1_rt::rc_set_insert(acc, b.name.clone()) - }, + |acc: Rc>, b: _| v1_rt::rc_set_insert(acc, b.name.clone()), ) } @@ -18359,7 +18443,7 @@ pub fn build_module_exported_type_name_index( ) -> Rc>>> { modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>>(), - |acc: Rc>>>, m: Rc| { + |acc: Rc>>>, m: _| { v1_rt::rc_map_insert( acc, authored_name_at(source_indices.clone(), m.module.clone()), @@ -18501,7 +18585,7 @@ pub fn rewire_type_env_import_str_binding_identity( str_bindings: m.type_env.clone().str_bindings.clone(), ancestry_str_bindings: m.type_env.clone().ancestry_str_bindings.clone(), }), - |acc: Rc, name: String| { + |acc: _, name: String| { rewire_inherited_str_binding( type_name_index.clone(), import_export_names.clone(), @@ -18552,7 +18636,7 @@ pub fn compiler_kernel_type_env( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, name: String| { + |acc: _, name: String| { v1_rt::rc_map_insert( acc, intern(intern_table.clone(), name.clone()).id.clone(), @@ -18753,7 +18837,7 @@ pub fn rewire_type_env_parent_links( { let index = modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, m: Rc| { + |acc: _, m: _| { v1_rt::rc_map_insert( acc, authored_name_at(source_indices.clone(), m.module.clone()), @@ -18858,7 +18942,7 @@ pub fn rewire_func_env_parent_links( { let index = modules.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, m: Rc| { + |acc: _, m: _| { v1_rt::rc_map_insert( acc, authored_name_at(source_indices.clone(), m.module.clone()), diff --git a/src/v1/stage0/src/v1_compiler_infer_emit_info.rs b/src/v1/stage0/src/v1_compiler_infer_emit_info.rs index bcfc9bd5298..0c25aaaea7c 100644 --- a/src/v1/stage0/src/v1_compiler_infer_emit_info.rs +++ b/src/v1/stage0/src/v1_compiler_infer_emit_info.rs @@ -315,11 +315,7 @@ pub fn derive_variant_to_enum( .cloned() .fold( v1_rt::rc_empty_map::(), - |acc: Rc>, summary: Rc| match (*summary - .repr - .clone()) - .clone() - { + |acc: Rc>, summary: _| match (*summary.repr.clone()).clone() { TypeRepr::EnumRepr { unit_only: _, .. } => { Rc::new(v1_rt::map_keys(&summary.variant_name_set.clone())) .iter() @@ -451,7 +447,7 @@ pub fn build_struct_field_summaries( .cloned() .fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, pair: (i64, Rc)| { + |acc: _, pair: (i64, Rc)| { let idx = pair.0.clone(); let child = pair.1.clone(); if (child.inferred.clone() == None) { @@ -595,24 +591,22 @@ pub fn build_enum_field_summaries( }); consistent.clone().iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, field_name: String| { - match find_first_enum_field_node( - variants.clone(), + |acc: _, field_name: String| match find_first_enum_field_node( + variants.clone(), + field_name.clone(), + source_indices.clone(), + ) { + Some(first_field) => v1_rt::rc_map_insert( + acc.clone(), field_name.clone(), - source_indices.clone(), - ) { - Some(first_field) => v1_rt::rc_map_insert( - acc.clone(), - field_name.clone(), - Rc::new(FieldSummary { - access_style: FieldAccessStyle::EnumAccessor, - value_shape: field_value_shape_from_type_node(child_type_node( - first_field.clone(), - )), - }), - ), - None => acc.clone(), - } + Rc::new(FieldSummary { + access_style: FieldAccessStyle::EnumAccessor, + value_shape: field_value_shape_from_type_node(child_type_node( + first_field.clone(), + )), + }), + ), + None => acc.clone(), }, ) } @@ -811,10 +805,7 @@ pub fn close_fn_fields( ) -> Rc>> { Rc::new(v1_rt::map_keys(&summaries)).iter().cloned().fold( summaries.clone(), - |acc: Rc>>, name: String| match v1_rt::map_get( - &summaries, - name.clone(), - ) { + |acc: _, name: String| match v1_rt::map_get(&summaries, name.clone()) { Some(s) => { if (!s.has_fn_fields.clone() && type_summary_reaches_fn( @@ -869,80 +860,64 @@ pub fn add_emit_item_summary( }; match build_type_summary(item.clone(), source_indices.clone()) { Some(summary) => { - let with_variants = - match (*summary.repr.clone()).clone() { - TypeRepr::EnumRepr { unit_only: _, .. } => { - item.children.clone().iter().cloned().fold( - state.type_summaries.clone(), - |acc: Rc>>, variant: Rc| { - if ((variant.children.clone().len() as i64) > 0) { - { - let v_has_fn = { - let mut __found = false; - for vc in variant.children.clone().iter().cloned() { - if match vc.inferred.clone().as_deref().cloned() - { - Some(InferredNode::Resolved { - node: rt, - .. - }) => { - (rt.connective.clone() - == Connective::Arrow) - } - _ => false, - } { - __found = true; - break; - } - } - __found - }; - let vname = authored_name_at( - source_indices.clone(), + let with_variants = match (*summary.repr.clone()).clone() { + TypeRepr::EnumRepr { unit_only: _, .. } => item + .children + .clone() + .iter() + .cloned() + .fold(state.type_summaries.clone(), |acc: _, variant: Rc| { + if ((variant.children.clone().len() as i64) > 0) { + { + let v_has_fn = { + let mut __found = false; + for vc in variant.children.clone().iter().cloned() { + if match vc.inferred.clone().as_deref().cloned() { + Some(InferredNode::Resolved { + node: rt, .. + }) => (rt.connective.clone() == Connective::Arrow), + _ => false, + } { + __found = true; + break; + } + } + __found + }; + let vname = + authored_name_at(source_indices.clone(), variant.clone()); + let qualified_vname = + variant_summary_key(summary.name.clone(), vname.clone()); + let variant_field_types = build_field_type_map( + variant.children.clone(), + source_indices.clone(), + ); + v1_rt::rc_map_insert( + acc.clone(), + qualified_vname.clone(), + Rc::new(TypeSummary { + name: qualified_vname.clone(), + repr: Rc::new(TypeRepr::StructRepr), + field_summaries: build_struct_field_summaries( variant.clone(), - ); - let qualified_vname = variant_summary_key( - summary.name.clone(), - vname.clone(), - ); - let variant_field_types = build_field_type_map( - variant.children.clone(), source_indices.clone(), - ); - v1_rt::rc_map_insert( - acc.clone(), - qualified_vname.clone(), - Rc::new(TypeSummary { - name: qualified_vname.clone(), - repr: Rc::new(TypeRepr::StructRepr), - field_summaries: build_struct_field_summaries( - variant.clone(), - source_indices.clone(), - ), - field_type_map: variant_field_types - .field_types - .clone(), - field_import_surface_names: variant_field_types - .import_surface_names - .clone(), - variant_name_set: v1_rt::rc_empty_map::< - String, - bool, - >( - ), - generic_param_names: Rc::new(vec![]), - has_fn_fields: v_has_fn.clone(), - }), - ) - } - } else { - acc.clone() - } - }, - ) - } - _ => state.type_summaries.clone(), - }; + ), + field_type_map: variant_field_types.field_types.clone(), + field_import_surface_names: variant_field_types + .import_surface_names + .clone(), + variant_name_set: v1_rt::rc_empty_map::(), + generic_param_names: Rc::new(vec![]), + has_fn_fields: v_has_fn.clone(), + }), + ) + } + } else { + acc.clone() + } + }), + _ => state.type_summaries.clone(), + }; let next_summaries = v1_rt::rc_map_insert( with_variants.clone(), summary.name.clone(), diff --git a/src/v1/stage0/src/v1_compiler_infer_env.rs b/src/v1/stage0/src/v1_compiler_infer_env.rs index a35ffa7c72b..32391c6aa8e 100644 --- a/src/v1/stage0/src/v1_compiler_infer_env.rs +++ b/src/v1/stage0/src/v1_compiler_infer_env.rs @@ -10,6 +10,13 @@ use crate::std_induction::SubValueRelation::{PreservedValue, SubValueUnknown}; pub use crate::std_induction::{InductiveField, RecursionShape, SubValueRelation}; pub use crate::std_types::is_kernel_type; pub use crate::std_types::SourceSpan; +pub use crate::v1_compiler_infer_occurrence_binding::ModulePathBindingProjection; +use crate::v1_compiler_infer_occurrence_binding::ModulePathBindingProjection::{ + ModulePathBindingAmbiguous, ModulePathBindingHit, ModulePathBindingMiss, +}; +pub use crate::v1_compiler_infer_occurrence_binding::{ + ambiguity_labels_from_decide, module_path_owner_binding_decide, +}; use crate::v1_rt; use crate::v1_rt::{VecCompat, VecJoin}; use crate::v1_std_core::Cardinality::*; @@ -57,7 +64,7 @@ pub struct TypeBinding { pub fn global_bare_fallback_invariant() -> String { thread_local! { static CACHED: String = { - "Corpus-wide bare-name census, resolved by ONE uniform containment walk (operator ruling 2026-07-18: global uniqueness is NOT a special tier — it is the shallowest level of the same walk; filepaths are irrelevant, the declared module path is the containment tree). SymbolIndex.global_bare is keyed on the bare declared name and built once by build_symbol_index_census over graph.modules before any module typechecks (order-independent). Tracking is decl-only via symbol_index_insert_decl / local_binding_for_item (type/fn/data names) plus corpus-globally-unique Disj variant aliases (unique across the WHOLE bare-name space: a variant whose name any type/fn/data decl claims stays qualified-only, never a global_bare candidate — else a type-vs-variant tie, e.g. actions.Job vs ExpressionContext.Job, refuses every far use of the TYPE); every homonym keeps its FULL candidate list (module_path + binding), never a candidate-free Ambiguous tombstone. Resolution (global_bare_lookup): a single candidate resolves from anywhere (the one-candidate degenerate case of the walk); multiple candidates resolve by nearest-ancestor containment — the candidate whose module path shares the strictly longest leading-segment prefix with the REFERENCING module (TypeEnv.module_path) wins; any tie at the max, including the all-disjoint lcp=0 case, REFUSES (Absent — fail-closed, never guesses, §5; the source must qualify by containment path). lookup_binding_by_name consults it only after str_bindings/ancestry_str_bindings/intern+bindings all miss. Variant arms additionally merge into per-module variant_locals via merge_global_bare_variant_locals (constructor_binding_authority — owner is the coproduct node).".to_string() + "Corpus-wide bare-name census (operator ruling 2026-07-18: filepaths are irrelevant — the declared module path is the containment tree). SymbolIndex.global_bare is keyed on the bare declared name and built once by build_symbol_index_census over graph.modules before any module typechecks (order-independent). Tracking is decl-only via symbol_index_insert_decl / local_binding_for_item (type/fn/data names) plus corpus-globally-unique Disj variant aliases (unique across the WHOLE bare-name space: a variant whose name any type/fn/data decl claims stays qualified-only, never a global_bare candidate — else a type-vs-variant tie, e.g. actions.Job vs ExpressionContext.Job, refuses every far use of the TYPE); every homonym keeps its FULL candidate list (module_path + binding), never a candidate-free Ambiguous tombstone. Resolution (global_bare_lookup / unique_on_chain_policy_note — ONE authority, review 45102): candidates are filtered to the referencing module's containment chain (declaring module path is a leading-segment prefix of TypeEnv.module_path, or equal); cardinality then routes through module_path_owner_binding_decide (0 → Unresolved/Absent, 1 → bind, 2+ → Ambiguous). A corpus-unique name off-chain does NOT resolve from anywhere — zero on-chain never authorizes whole-corpus search. Nearest-ancestor / first-hit selection is retired on these production surfaces (global_bare_nearest_ancestor* remains only for silent-pick recording of the old LCP heuristic, not for binding). lookup_binding_by_name consults global_bare only after str_bindings/ancestry_str_bindings/intern+bindings all miss. Variant arms additionally merge into per-module variant_locals via merge_global_bare_variant_locals (constructor_binding_authority — owner is the coproduct node).".to_string() }; } CACHED.with(|c: &String| c.clone()) @@ -420,10 +427,7 @@ pub fn guarded_union_str_bindings_into_acc( bindings: acc.clone(), conflicts: conflicts.clone(), }), - |state: Rc, name: String| match v1_rt::map_get( - &overlay, - name.clone(), - ) { + |state: _, name: String| match v1_rt::map_get(&overlay, name.clone()) { None => state.clone(), Some(incoming) => match v1_rt::map_get(&state.bindings.clone(), name.clone()) { None => Rc::new(GuardedStrBindingsUnion { @@ -490,8 +494,7 @@ pub fn guarded_union_str_bindings_into_overlay( bindings: overlay.clone(), conflicts: conflicts.clone(), }), - |state: Rc, name: String| match v1_rt::map_get(&acc, name.clone()) - { + |state: _, name: String| match v1_rt::map_get(&acc, name.clone()) { None => state.clone(), Some(accumulated) => match v1_rt::map_get(&state.bindings.clone(), name.clone()) { None => Rc::new(GuardedStrBindingsUnion { @@ -680,38 +683,38 @@ pub fn union_variant_locals_into_acc( acc: Rc>>, overlay: Rc>>, ) -> Rc>> { - Rc::new(v1_rt::map_keys(&overlay)).iter().cloned().fold( - acc.clone(), - |m: Rc>>, name: String| match v1_rt::map_get( - &overlay, - name.clone(), - ) { - None => m.clone(), - Some(incoming) => match v1_rt::map_get(&m, name.clone()) { - None => v1_rt::rc_map_insert(m.clone(), name.clone(), incoming.clone()), - Some(_existing) => v1_rt::rc_map_insert(m.clone(), name.clone(), incoming.clone()), - }, - }, - ) + Rc::new(v1_rt::map_keys(&overlay)) + .iter() + .cloned() + .fold(acc.clone(), |m: _, name: String| { + match v1_rt::map_get(&overlay, name.clone()) { + None => m.clone(), + Some(incoming) => match v1_rt::map_get(&m, name.clone()) { + None => v1_rt::rc_map_insert(m.clone(), name.clone(), incoming.clone()), + Some(_existing) => { + v1_rt::rc_map_insert(m.clone(), name.clone(), incoming.clone()) + } + }, + } + }) } pub fn union_variant_locals_into_overlay( acc: Rc>>, overlay: Rc>>, ) -> Rc>> { - Rc::new(v1_rt::map_keys(&acc)).iter().cloned().fold( - overlay.clone(), - |m: Rc>>, name: String| match v1_rt::map_get( - &acc, - name.clone(), - ) { - None => m.clone(), - Some(accumulated) => match v1_rt::map_get(&m, name.clone()) { - None => v1_rt::rc_map_insert(m.clone(), name.clone(), accumulated.clone()), - Some(_incoming) => m.clone(), - }, - }, - ) + Rc::new(v1_rt::map_keys(&acc)) + .iter() + .cloned() + .fold(overlay.clone(), |m: _, name: String| { + match v1_rt::map_get(&acc, name.clone()) { + None => m.clone(), + Some(accumulated) => match v1_rt::map_get(&m, name.clone()) { + None => v1_rt::rc_map_insert(m.clone(), name.clone(), accumulated.clone()), + Some(_incoming) => m.clone(), + }, + } + }) } pub fn union_variant_locals_skip_equal( @@ -789,9 +792,7 @@ pub fn str_bindings_from_bindings( ) -> Rc>> { Rc::new(v1_rt::map_values(&bindings)).iter().cloned().fold( v1_rt::rc_empty_map::>(), - |acc: Rc>>, binding: Rc| { - v1_rt::rc_map_insert(acc, binding.name.clone(), binding.clone()) - }, + |acc: _, binding: _| v1_rt::rc_map_insert(acc, binding.name.clone(), binding.clone()), ) } @@ -920,7 +921,7 @@ pub fn global_bare_nearest_ancestor_candidate( best: None, tie: false, }), - |acc: Rc, cand: Rc| { + |acc: _, cand: _| { let l = segment_lcp_len( env_segs.clone(), module_path_segments(cand.module_path.clone()), @@ -964,7 +965,7 @@ pub fn global_bare_nearest_ancestor( pub fn unique_on_chain_policy_note() -> String { thread_local! { static CACHED: String = { - "namespace-resolution-design.md 13 (operator-ratified 2026-07-21), landed as 8 step 1: under NameResolutionPolicy = NamespaceOnlyY (name_resolution_policy_is_namespace_only, thread-local host gate, default ON = NamespaceOnlyY (8 step 4 flip); host bracket false = ImportScoped byte-for-byte), a bare homonym resolves to the UNIQUE binder on the referencing module's ancestor chain — a candidate is on the chain iff its declaring module path is a leading-segment prefix of (or equal to) TypeEnv.module_path. Exactly one on-chain candidate resolves; zero or two-plus REFUSES (Absent from lookup + global_bare_is_ambiguous true, surfaced as the typed AmbiguousReference diagnostic at the reference site) — no nearest-wins, no fallback chain: adding a nearer homonym must loudly break a reference, never silently rebind it (the 13 edit-stability invariant). The zero-on-chain whole-pool-homonym case is Ambiguous, not Unresolved, mirroring the census containment walk (cli_run.rs containment_resolve_fn_v1: lexical Unbound + GlobalBareAmbiguousBinding => Ambiguous).".to_string() + "namespace-resolution-design.md 13 (operator-ratified 2026-07-21), namespace-canonical-binding: bare homonym cardinality on chain-filtered populations routes through module_path_owner_binding_decide (0 → Unresolved, 1 → bind, 2+ → Ambiguous with full chain population). A candidate is on the chain iff its declaring module path is a leading-segment prefix of (or equal to) TypeEnv.module_path. Zero on-chain never authorizes whole-corpus search. The host NameResolutionPolicy gate no longer selects parallel nearest-wins/first-hit paths on these production surfaces (roadmap out_of_scope: no configuration switch between old and new behaviour).".to_string() }; } CACHED.with(|c: &String| c.clone()) @@ -998,9 +999,28 @@ pub fn global_bare_unique_chain_candidate( ) -> Option> { { let chain = global_bare_chain_candidates(env_module_path.clone(), candidates.clone()); - match ((chain.clone().len() as i64) == 1) { - true => chain.clone().first().cloned(), - false => None, + match (*module_path_owner_binding_decide(Rc::new({ + let mut __result = Vec::new(); + for c in chain.clone().iter().cloned() { + __result.push(c.module_path.clone()); + } + __result + }))) + .clone() + { + ModulePathBindingProjection::ModulePathBindingHit { owner: owner, .. } => Rc::new({ + let mut __result = Vec::new(); + for c in chain.clone().iter().cloned() { + if (c.module_path.clone() == owner.clone()) { + __result.push(c); + } + } + __result + }) + .first() + .cloned(), + ModulePathBindingProjection::ModulePathBindingMiss => None, + ModulePathBindingProjection::ModulePathBindingAmbiguous { owners: _, .. } => None, } } } @@ -1009,50 +1029,30 @@ pub fn global_bare_policy_candidate( env_module_path: String, candidates: Rc>>, ) -> Option> { - if v1_rt::name_resolution_policy_is_namespace_only() { - global_bare_unique_chain_candidate(env_module_path.clone(), candidates.clone()) - } else { - global_bare_nearest_ancestor_candidate(env_module_path.clone(), candidates.clone()) - } + global_bare_unique_chain_candidate(env_module_path.clone(), candidates.clone()) } pub fn global_bare_strict_ambiguity_candidates(env: Rc, name: String) -> Rc> { + match v1_rt::map_get(&env.symbol_index.clone().global_bare.clone(), name.clone()) + .as_deref() + .cloned() { - if (v1_rt::name_resolution_policy_is_namespace_only() == false) { - return Rc::new(vec![]); - } - match v1_rt::map_get(&env.symbol_index.clone().global_bare.clone(), name.clone()) - .as_deref() - .cloned() - { - Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { - candidates: cands, .. - }) => { - let chain = global_bare_chain_candidates(env.module_path.clone(), cands.clone()); - if ((chain.clone().len() as i64) == 1) { - Rc::new(vec![]) - } else { - { - let pool = if ((chain.clone().len() as i64) >= 2) { - chain.clone() - } else { - cands.clone() - }; - Rc::new({ - let mut __result = Vec::new(); - for c in pool.clone().iter().cloned() { - __result.push(v1_rt::concat( - v1_rt::concat(c.module_path.clone(), ".".to_string()), - name.clone(), - )); - } - __result - }) + Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { + candidates: cands, .. + }) => { + let chain = global_bare_chain_candidates(env.module_path.clone(), cands.clone()); + ambiguity_labels_from_decide( + Rc::new({ + let mut __result = Vec::new(); + for c in chain.clone().iter().cloned() { + __result.push(c.module_path.clone()); } - } - } - _ => Rc::new(vec![]), + __result + }), + name.clone(), + ) } + _ => Rc::new(vec![]), } } @@ -1091,9 +1091,22 @@ pub fn global_bare_owner_module( module_path: mp, binding: b, .. - }) => match binding_declares_name(b.clone(), name.clone(), env.source_indices.clone()) { - true => Some(mp.clone()), - false => None, + }) => match global_bare_unique_chain_candidate( + owner_module_path.clone(), + Rc::new(vec![Rc::new(GlobalBareCandidate { + module_path: mp.clone(), + binding: b.clone(), + })]), + ) { + Some(cand) => match binding_declares_name( + cand.binding.clone(), + name.clone(), + env.source_indices.clone(), + ) { + true => Some(cand.module_path.clone()), + false => None, + }, + None => None, }, Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { candidates: cands, .. @@ -1388,32 +1401,26 @@ pub fn global_bare_lookup(env: Rc, name: String) -> Option { - Some(binding.clone()) - } + Some(GlobalBareLookupState::GlobalBareUniqueBinding { + module_path: mp, + binding, + .. + }) => match global_bare_unique_chain_candidate( + env.module_path.clone(), + Rc::new(vec![Rc::new(GlobalBareCandidate { + module_path: mp.clone(), + binding: binding.clone(), + })]), + ) { + Some(cand) => Some(cand.binding.clone()), + None => None, + }, Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { candidates: cands, .. - }) => { - if v1_rt::name_resolution_policy_is_namespace_only() { - match global_bare_unique_chain_candidate(env.module_path.clone(), cands.clone()) { - Some(cand) => Some(cand.binding.clone()), - None => None, - } - } else { - { - if (v1_rt::resolution_silent_pick_is_enabled() - && ((cands.clone().len() as i64) >= 2)) - { - record_global_bare_ambiguous_silent_pick( - env.module_path.clone(), - name.clone(), - cands.clone(), - ) - } - global_bare_nearest_ancestor(env.module_path.clone(), cands.clone()) - } - } - } + }) => match global_bare_unique_chain_candidate(env.module_path.clone(), cands.clone()) { + Some(cand) => Some(cand.binding.clone()), + None => None, + }, None => None, } } @@ -1426,10 +1433,19 @@ pub fn global_bare_is_ambiguous(env: Rc, name: String) -> bool { Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { candidates: cands, .. }) => { - if v1_rt::name_resolution_policy_is_namespace_only() { - (global_bare_unique_chain_candidate(env.module_path.clone(), cands.clone()) == None) - } else { - (global_bare_nearest_ancestor(env.module_path.clone(), cands.clone()) == None) + let chain = global_bare_chain_candidates(env.module_path.clone(), cands.clone()); + match (*module_path_owner_binding_decide(Rc::new({ + let mut __result = Vec::new(); + for c in chain.clone().iter().cloned() { + __result.push(c.module_path.clone()); + } + __result + }))) + .clone() + { + ModulePathBindingProjection::ModulePathBindingAmbiguous { owners: _, .. } => true, + ModulePathBindingProjection::ModulePathBindingHit { owner: _, .. } => false, + ModulePathBindingProjection::ModulePathBindingMiss => false, } } Some(GlobalBareLookupState::GlobalBareUniqueBinding { .. }) => false, @@ -1554,7 +1570,7 @@ pub fn inductive_fields_for(env: Rc, type_name: String) -> Rc>>, parent: Rc| { + |acc: _, parent: Rc| { if ((acc.clone().len() as i64) > 0) { acc.clone() } else { @@ -1721,49 +1737,45 @@ pub fn merge_inductive_fields( ) -> Rc>>>> { Rc::new(v1_rt::map_keys(&right)).iter().cloned().fold( left.clone(), - |acc: Rc>>>>, type_name: String| { - match v1_rt::map_get(&right, type_name.clone()) { - Some(incoming) => match v1_rt::map_get(&acc, type_name.clone()) { - Some(existing) => { - if (existing.clone() == incoming.clone()) { - acc.clone() - } else { - { - let seen = existing.clone().iter().cloned().fold( - v1_rt::rc_empty_set::<_>(), - |s: _, f: Rc| { - v1_rt::rc_set_insert(s, inductive_field_key(f.clone())) - }, - ); - let additions = Rc::new({ - let mut __result = Vec::new(); - for f in incoming.clone().iter().cloned() { - if (v1_rt::set_contains( - &seen, - inductive_field_key(f.clone()), - ) == false) - { - __result.push(f); - } + |acc: _, type_name: String| match v1_rt::map_get(&right, type_name.clone()) { + Some(incoming) => match v1_rt::map_get(&acc, type_name.clone()) { + Some(existing) => { + if (existing.clone() == incoming.clone()) { + acc.clone() + } else { + { + let seen = existing.clone().iter().cloned().fold( + v1_rt::rc_empty_set::<_>(), + |s: _, f: _| { + v1_rt::rc_set_insert(s, inductive_field_key(f.clone())) + }, + ); + let additions = Rc::new({ + let mut __result = Vec::new(); + for f in incoming.clone().iter().cloned() { + if (v1_rt::set_contains(&seen, inductive_field_key(f.clone())) + == false) + { + __result.push(f); } - __result - }); - if ((additions.clone().len() as i64) == 0) { - acc.clone() - } else { - v1_rt::rc_map_insert( - acc.clone(), - type_name.clone(), - v1_rt::concat(existing.clone(), additions.clone()), - ) } + __result + }); + if ((additions.clone().len() as i64) == 0) { + acc.clone() + } else { + v1_rt::rc_map_insert( + acc.clone(), + type_name.clone(), + v1_rt::concat(existing.clone(), additions.clone()), + ) } } } - None => v1_rt::rc_map_insert(acc.clone(), type_name.clone(), incoming.clone()), - }, - None => acc.clone(), - } + } + None => v1_rt::rc_map_insert(acc.clone(), type_name.clone(), incoming.clone()), + }, + None => acc.clone(), }, ) } @@ -1773,7 +1785,7 @@ pub fn inductive_fields_list_to_map( ) -> Rc>>>> { fields.clone().iter().cloned().fold( v1_rt::rc_empty_map::>>>(), - |acc: Rc>>>>, field: Rc| { + |acc: _, field: _| { let existing = match v1_rt::map_get(&acc, field.type_name.clone()) { Some(fs) => fs.clone(), None => Rc::new(vec![]), diff --git a/src/v1/stage0/src/v1_compiler_infer_lookup.rs b/src/v1/stage0/src/v1_compiler_infer_lookup.rs index 50864d09071..7dffa57c10c 100644 --- a/src/v1/stage0/src/v1_compiler_infer_lookup.rs +++ b/src/v1/stage0/src/v1_compiler_infer_lookup.rs @@ -18,11 +18,14 @@ pub use crate::v1_compiler_infer_emit_info::{ }; use crate::v1_compiler_infer_env::GlobalBareLookupState::*; pub use crate::v1_compiler_infer_env::{ - authored_name, borrowed_generic_param_names, global_bare_policy_candidate, is_recursive_type, - lookup_binding_by_name, lookup_binding_by_name_local, lookup_type, lookup_type_for, - qualified_all_but_last, qualify_borrowed_type_names, symbol_index_lookup, + authored_name, borrowed_generic_param_names, global_bare_policy_candidate, + global_bare_unique_chain_candidate, is_recursive_type, lookup_binding_by_name, + lookup_binding_by_name_local, lookup_type, lookup_type_for, qualified_all_but_last, + qualify_borrowed_type_names, symbol_index_lookup, +}; +pub use crate::v1_compiler_infer_env::{ + GlobalBareCandidate, GlobalBareLookupState, TypeBinding, TypeEnv, }; -pub use crate::v1_compiler_infer_env::{GlobalBareLookupState, TypeBinding, TypeEnv}; pub use crate::v1_compiler_infer_method::infer_builtin_call_type; pub use crate::v1_compiler_infer_service::check_service_method_call_node; pub use crate::v1_compiler_infer_service::{OpEntry, ServiceMethodResult}; @@ -142,10 +145,19 @@ pub fn borrowed_census_decl(type_env: Rc, name: String) -> Option Some(Rc::new(BorrowedCensusDecl { - owner_module_path: mp.clone(), - node: b.resolved.clone(), - })), + }) => match global_bare_unique_chain_candidate( + type_env.module_path.clone(), + Rc::new(vec![Rc::new(GlobalBareCandidate { + module_path: mp.clone(), + binding: b.clone(), + })]), + ) { + Some(cand) => Some(Rc::new(BorrowedCensusDecl { + owner_module_path: cand.module_path.clone(), + node: cand.binding.clone().resolved.clone(), + })), + None => None, + }, Some(GlobalBareLookupState::GlobalBareAmbiguousBinding { candidates: cands, .. }) => match global_bare_policy_candidate(type_env.module_path.clone(), cands.clone()) { diff --git a/src/v1/stage0/src/v1_compiler_infer_occurrence_binding.rs b/src/v1/stage0/src/v1_compiler_infer_occurrence_binding.rs new file mode 100644 index 00000000000..7c6d40647be --- /dev/null +++ b/src/v1/stage0/src/v1_compiler_infer_occurrence_binding.rs @@ -0,0 +1,80 @@ +// Generated by v1 compiler -- do not edit. +// Source module: v1.compiler.infer_occurrence_binding + +use self::ModulePathBindingProjection::*; +use crate::v1_rt; +use crate::v1_rt::{VecCompat, VecJoin}; +use crate::NonEmptyBTreeSet; +use crate::NonEmptyVec; +use im::{vector as vec, HashMap, OrdSet as BTreeSet, Vector as Vec}; +use std::rc::Rc; + +pub fn infer_occurrence_binding_canonical_decide_note() -> String { + thread_local! { + static CACHED: String = { + "v1 production adapter: global_bare chain and func parent-closure cardinality fold through module_path_owner_binding_decide, which mirrors occurrence_binding_from_candidates 0/1/many semantics on owner module paths without importing generic std.occurrence_binding into stage0 (generic emission lacks Clone/serde bounds). Candidate enumeration stays in infer_env/infer_sigs. Scaffold receipt: gunbc.infer_occurrence_binding_scaffold (binds std.occurrence_binding_resolve.module_path_binding_decide; witness: dag/test/claim/infer_occurrence_binding_scaffold_witness_test.dag). DISSOLVE-ON: stage0 emits std.occurrence_binding_resolve and this adapter delegates to module_path_binding_decide by execution.".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +#[derive(Debug, Clone, PartialEq, serde::Serialize, serde::Deserialize)] +#[serde(tag = "_variant")] +pub enum ModulePathBindingProjection { + ModulePathBindingHit { owner: String }, + ModulePathBindingMiss, + ModulePathBindingAmbiguous { owners: Rc> }, +} + +pub fn module_path_owner_binding_decide( + owners: Rc>, +) -> Rc { + { + let owner_count = (owners.clone().len() as i64); + if (owner_count.clone() == 0) { + Rc::new(ModulePathBindingProjection::ModulePathBindingMiss) + } else { + if (owner_count.clone() == 1) { + match owners.clone().first().cloned() { + Some(owner) => Rc::new(ModulePathBindingProjection::ModulePathBindingHit { + owner: owner.clone(), + }), + None => Rc::new(ModulePathBindingProjection::ModulePathBindingMiss), + } + } else { + Rc::new(ModulePathBindingProjection::ModulePathBindingAmbiguous { + owners: owners.clone(), + }) + } + } + } +} + +pub fn ambiguity_labels_single_authority_note() -> String { + thread_local! { + static CACHED: String = { + "ONE labeller for both production candidate sites (review 45364). global_bare_chain_ambiguity_labels_from_decide and func_parent_closure_ambiguity_labels_from_decide were token-identical modulo a local bind name -- a section 3 nickname pair, two names for one concept, which the predicate-dissolution pass left resident. The call site is not part of the fact: qualifying an ambiguous owner list is the same operation whether the candidates came from the global_bare chain (04_env) or a fn parent closure (04_sigs), so the site-prefixed names encoded a distinction that does not exist. Collapsed to ambiguity_labels_from_decide, consumed by both.\n\nWILDCARD-FREE (review 45417): the collapsed fn inherited a _ => [] arm from the two it replaced. ModulePathBindingProjection is a closed 3-arm type, so a wildcard means a future variant silently yields no labels -- an ambiguity that reports as unambiguous, which is the DESIGN section 5 absorbing shape and the same arm this PR deleted from v1.std.core diagnostic_to_span. Hit and Miss are now spelled out, so adding a variant is a compile error here rather than a silent empty label list.".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + +pub fn ambiguity_labels_from_decide(owners: Rc>, name: String) -> Rc> { + match (*module_path_owner_binding_decide(owners.clone())).clone() { + ModulePathBindingProjection::ModulePathBindingAmbiguous { + owners: ambiguous_owners, + .. + } => Rc::new({ + let mut __result = Vec::new(); + for owner in ambiguous_owners.clone().iter().cloned() { + __result.push(v1_rt::concat( + v1_rt::concat(owner.clone(), ".".to_string()), + name.clone(), + )); + } + __result + }), + ModulePathBindingProjection::ModulePathBindingHit { owner: _, .. } => Rc::new(vec![]), + ModulePathBindingProjection::ModulePathBindingMiss => Rc::new(vec![]), + } +} diff --git a/src/v1/stage0/src/v1_compiler_infer_resolve.rs b/src/v1/stage0/src/v1_compiler_infer_resolve.rs index faa6b16b33b..6e40138a7b7 100644 --- a/src/v1/stage0/src/v1_compiler_infer_resolve.rs +++ b/src/v1/stage0/src/v1_compiler_infer_resolve.rs @@ -126,26 +126,27 @@ pub fn collect_unit_variant_phantom_matches( variant_name: String, ) -> Rc>> { { - let direct_bindings = env.parents.clone().iter().cloned().fold( - env.str_bindings.clone(), - |acc: Rc>>, parent: Rc| { + let direct_bindings = env + .parents + .clone() + .iter() + .cloned() + .fold(env.str_bindings.clone(), |acc: _, parent: Rc| { v1_rt::rc_map_merge(parent.str_bindings.clone(), acc) - }, - ); + }); Rc::new(v1_rt::map_values(&direct_bindings)) .iter() .cloned() - .fold( - Rc::new(vec![]), - |acc: Rc>>, binding: Rc| match unit_variant_in_coproduct( + .fold(Rc::new(vec![]), |acc: Rc>>, binding: _| { + match unit_variant_in_coproduct( env.clone(), structural_type_for_variant_lookup(env.clone(), binding.resolved.clone()), variant_name.clone(), ) { Some(variant) => v1_rt::concat(acc.clone(), Rc::new(vec![variant.clone()])), None => acc.clone(), - }, - ) + } + }) } } diff --git a/src/v1/stage0/src/v1_compiler_infer_service.rs b/src/v1/stage0/src/v1_compiler_infer_service.rs index 6f54431eb79..aaef805d8ca 100644 --- a/src/v1/stage0/src/v1_compiler_infer_service.rs +++ b/src/v1/stage0/src/v1_compiler_infer_service.rs @@ -210,7 +210,7 @@ pub fn expand_transitive_services_once( modules: Rc>>, registry: Rc>>, ) -> Rc>> { - modules.clone().iter().cloned().fold(registry.clone(), |reg: Rc>>, m: Rc| m.items.clone().iter().cloned().fold(reg, |reg2: Rc>>, item: Rc| { + modules.clone().iter().cloned().fold(registry.clone(), |reg: _, m: _| m.items.clone().iter().cloned().fold(reg, |reg2: _, item: Rc| { let item_name = authored_name_at(m.type_env.clone().source_indices.clone(), item.clone()); match v1_rt::map_get(®2, item_name.clone()) { Some(info) => { @@ -256,7 +256,7 @@ pub fn total_service_count(registry: Rc>>) -> i64 { Rc::new(v1_rt::map_values(®istry)) .iter() .cloned() - .fold(0, |acc: i64, info: Rc| { + .fold(0, |acc: i64, info: _| { (acc + (info.service_names.clone().len() as i64)) }) } diff --git a/src/v1/stage0/src/v1_compiler_infer_sigs.rs b/src/v1/stage0/src/v1_compiler_infer_sigs.rs index 7d38aa5207e..f8809d8e678 100644 --- a/src/v1/stage0/src/v1_compiler_infer_sigs.rs +++ b/src/v1/stage0/src/v1_compiler_infer_sigs.rs @@ -4,6 +4,11 @@ use self::FuncSigLookup::*; pub use crate::std_induction::SubValueRelation; use crate::std_induction::SubValueRelation::*; +pub use crate::v1_compiler_infer_occurrence_binding::ModulePathBindingProjection; +use crate::v1_compiler_infer_occurrence_binding::ModulePathBindingProjection::*; +pub use crate::v1_compiler_infer_occurrence_binding::{ + ambiguity_labels_from_decide, module_path_owner_binding_decide, +}; pub use crate::v1_compiler_infer_types::emit_map_has; use crate::v1_rt; use crate::v1_rt::{VecCompat, VecJoin}; @@ -114,7 +119,7 @@ pub struct ParentSigScan { pub fn func_sig_lookup_outcome_note() -> String { thread_local! { static CACHED: String = { - "namespace-resolution-design.md 13 / 8 step 1, fn path: ResolvedFuncSig? overloaded Absent as 'keep looking' (the census fallback fires on it), so a refusal had nowhere to go — the first-hit over func_env.parents was the fn silent-pick class (fn_parent_first_hit) with NO refusal arm at all. FuncSigLookup is the 3-state outcome: FuncSigResolved binds, FuncSigUnresolved means genuinely-no-sig (census fallback may still run), FuncSigAmbiguous carries the full candidate list and REFUSES — it never falls through to a fallback. Under ImportScoped (host bracket false) the Ambiguous arm is unreachable (first-hit preserved verbatim); under the default NamespaceOnlyY policy exactly-one match across the flat parent closure resolves, two-plus refuses. Own-module local hit stays first on both arms: the killed class is the pick among >=2 PARENT matches (the census's fn_parent_first_hit definition), not own-decl precedence. Analysis-only consumers (provenance/descent enrichment) project through func_sig_if_resolved in infer_lookup — they never fabricate a bind; the semantic bind sites in 04_infer match the full outcome and emit the typed AmbiguousReference.".to_string() + "namespace-resolution-design.md 13 / 8 step 1, fn path: ResolvedFuncSig? overloaded Absent as 'keep looking' (the census fallback fires on it), so a refusal had nowhere to go — the first-hit over func_env.parents was the fn silent-pick class (fn_parent_first_hit) with NO refusal arm at all. FuncSigLookup is the 3-state outcome: FuncSigResolved binds, FuncSigUnresolved means genuinely-no-sig (census fallback may still run), FuncSigAmbiguous carries the full candidate list and REFUSES — it never falls through to a fallback. lookup_resolved_sig always routes parent misses through lookup_resolved_sig_unique_across_parents (module_path_owner_binding_decide): exactly-one owner across the parent closure resolves, zero is Unresolved, two-plus is Ambiguous — the ImportScoped first-hit branch is deleted, and the policy bracket must not restore it. Own-module local hit stays first: the killed class is the pick among >=2 PARENT matches (the census's fn_parent_first_hit definition), not own-decl precedence. Analysis-only consumers (provenance/descent enrichment) project through func_sig_if_resolved in infer_lookup — they never fabricate a bind; the semantic bind sites in 04_infer match the full outcome and emit the typed AmbiguousReference.".to_string() }; } CACHED.with(|c: &String| c.clone()) @@ -144,10 +149,7 @@ pub fn lookup_resolved_sig_unique_across_parents( first_sig: None, owners: Rc::new(vec![]), }), - |acc: Rc, p: Rc| match v1_rt::map_get( - &p.local.clone(), - name.clone(), - ) { + |acc: _, p: Rc| match v1_rt::map_get(&p.local.clone(), name.clone()) { Some(sig) => Rc::new(ChainSigScan { first_sig: if (acc.first_sig.clone() != None) { acc.first_sig.clone() @@ -159,27 +161,19 @@ pub fn lookup_resolved_sig_unique_across_parents( None => acc.clone(), }, ); - let owner_count = (scan.owners.clone().len() as i64); - if (owner_count.clone() == 0) { - Rc::new(FuncSigLookup::FuncSigUnresolved) - } else { - if (owner_count.clone() == 1) { + match (*module_path_owner_binding_decide(scan.owners.clone())).clone() { + ModulePathBindingProjection::ModulePathBindingMiss => { + Rc::new(FuncSigLookup::FuncSigUnresolved) + } + ModulePathBindingProjection::ModulePathBindingHit { owner: _, .. } => { match scan.first_sig.clone() { Some(sig) => Rc::new(FuncSigLookup::FuncSigResolved { sig: sig.clone() }), None => Rc::new(FuncSigLookup::FuncSigUnresolved), } - } else { + } + ModulePathBindingProjection::ModulePathBindingAmbiguous { owners: _, .. } => { Rc::new(FuncSigLookup::FuncSigAmbiguous { - candidates: Rc::new({ - let mut __result = Vec::new(); - for o in scan.owners.clone().iter().cloned() { - __result.push(v1_rt::concat( - v1_rt::concat(o.clone(), ".".to_string()), - name.clone(), - )); - } - __result - }), + candidates: ambiguity_labels_from_decide(scan.owners.clone(), name.clone()), }) } } @@ -197,10 +191,7 @@ pub fn lookup_resolved_sig_with_telemetry( match_count: 0, first_parent: None, }), - |acc: Rc, p: Rc| match v1_rt::map_get( - &p.local.clone(), - name.clone(), - ) { + |acc: _, p: Rc| match v1_rt::map_get(&p.local.clone(), name.clone()) { Some(sig) => Rc::new(ParentSigScan { sig: if (acc.sig.clone() != None) { acc.sig.clone() @@ -235,31 +226,7 @@ pub fn lookup_resolved_sig_with_telemetry( pub fn lookup_resolved_sig(env: Rc, name: String) -> Rc { match v1_rt::map_get(&env.local.clone(), name.clone()) { Some(sig) => Rc::new(FuncSigLookup::FuncSigResolved { sig: sig.clone() }), - None => { - if v1_rt::name_resolution_policy_is_namespace_only() { - lookup_resolved_sig_unique_across_parents(env.clone(), name.clone()) - } else { - { - let first_hit = if v1_rt::resolution_silent_pick_is_enabled() { - lookup_resolved_sig_with_telemetry(env.clone(), name.clone()) - } else { - env.parents.clone().iter().cloned().fold( - none_resolved_sig(), - |acc: Option>, p: Rc| match acc - .clone() - { - Some(sig) => Some(sig.clone()), - None => v1_rt::map_get(&p.local.clone(), name.clone()), - }, - ) - }; - match first_hit.clone() { - Some(sig) => Rc::new(FuncSigLookup::FuncSigResolved { sig: sig.clone() }), - None => Rc::new(FuncSigLookup::FuncSigUnresolved), - } - } - } - } + None => lookup_resolved_sig_unique_across_parents(env.clone(), name.clone()), } } @@ -417,20 +384,17 @@ pub fn merge_remaining_declared( Rc::new(v1_rt::map_values(&declared_sigs)) .iter() .cloned() - .fold( - resolved.clone(), - |acc: Rc>>, dsig: Rc| { - if (dsig.inferred.clone() != None) { - v1_rt::rc_map_insert( - acc.clone(), - dsig.name.clone(), - declared_to_resolved(dsig.clone()), - ) - } else { - acc.clone() - } - }, - ) + .fold(resolved.clone(), |acc: _, dsig: Rc| { + if (dsig.inferred.clone() != None) { + v1_rt::rc_map_insert( + acc.clone(), + dsig.name.clone(), + declared_to_resolved(dsig.clone()), + ) + } else { + acc.clone() + } + }) } pub fn topo_resolve_loop( @@ -450,21 +414,17 @@ pub fn topo_resolve_loop( let all_resolved = Rc::new(v1_rt::map_values(&declared_sigs)) .iter() .cloned() - .fold( - resolved.clone(), - |acc: Rc>>, - dsig: Rc| { - if (dsig.inferred.clone() != None) { - v1_rt::rc_map_insert( - acc.clone(), - dsig.name.clone(), - declared_to_resolved(dsig.clone()), - ) - } else { - acc.clone() - } - }, - ); + .fold(resolved.clone(), |acc: _, dsig: Rc| { + if (dsig.inferred.clone() != None) { + v1_rt::rc_map_insert( + acc.clone(), + dsig.name.clone(), + declared_to_resolved(dsig.clone()), + ) + } else { + acc.clone() + } + }); return Rc::new(ResolveFuncSigsResult { func_env: Rc::new(ResolvedFuncEnv { name: module_name.clone(), @@ -531,10 +491,8 @@ pub fn topo_resolve_loop( signatures: resolved.clone(), diagnostics: Rc::new(vec![]), }), - |acc: Rc, fn_name: String| match v1_rt::map_get( - &declared_sigs, - fn_name.clone(), - ) { + |acc: _, fn_name: String| match v1_rt::map_get(&declared_sigs, fn_name.clone()) + { Some(dsig) => { if (dsig.inferred.clone() != None) { Rc::new(SigsAccum { @@ -570,8 +528,7 @@ pub fn topo_resolve_loop( .cloned() .fold( cycle_accum.signatures.clone(), - |acc: Rc>>, - dsig: Rc| { + |acc: _, dsig: Rc| { if (dsig.inferred.clone() != None) { v1_rt::rc_map_insert( acc.clone(), @@ -601,10 +558,7 @@ pub fn topo_resolve_loop( signatures: resolved.clone(), diagnostics: diagnostics.clone(), }), - |acc: Rc, fn_name: String| match v1_rt::map_get( - &declared_sigs, - fn_name.clone(), - ) { + |acc: _, fn_name: String| match v1_rt::map_get(&declared_sigs, fn_name.clone()) { Some(dsig) => { if (dsig.inferred.clone() != None) { Rc::new(SigsAccum { diff --git a/src/v1/stage0/src/v1_compiler_ownership.rs b/src/v1/stage0/src/v1_compiler_ownership.rs index 278bc940a4c..cf114cf5a50 100644 --- a/src/v1/stage0/src/v1_compiler_ownership.rs +++ b/src/v1/stage0/src/v1_compiler_ownership.rs @@ -228,27 +228,33 @@ pub fn merge_branch_usages( branches: Rc>>, ) -> Rc { { - let binding_merged = branches.clone().iter().cloned().fold( - base.bindings.clone(), - |merged: Rc>>, branch: Rc| { - branch.touched.clone().iter().cloned().fold( - merged, - |acc: Rc>>, name: String| match v1_rt::map_get( - &branch.bindings.clone(), - name.clone(), - ) { - Some(usage) => map_usage_merge_at(acc.clone(), name.clone(), usage.clone()), - None => acc.clone(), - }, - ) - }, - ); - let touched_merged = branches.clone().iter().cloned().fold( - base.touched.clone(), - |acc: Rc>, branch: Rc| { + let binding_merged = + branches + .clone() + .iter() + .cloned() + .fold(base.bindings.clone(), |merged: _, branch: _| { + branch + .touched + .clone() + .iter() + .cloned() + .fold(merged, |acc: _, name: String| { + match v1_rt::map_get(&branch.bindings.clone(), name.clone()) { + Some(usage) => { + map_usage_merge_at(acc.clone(), name.clone(), usage.clone()) + } + None => acc.clone(), + } + }) + }); + let touched_merged = branches + .clone() + .iter() + .cloned() + .fold(base.touched.clone(), |acc: Rc>, branch: _| { v1_rt::concat(acc, branch.touched.clone()) - }, - ); + }); let base_fold_count = (base.fold_call_nodes.clone().len() as i64); let branch_fold_nodes = Rc::new({ let mut __result = Vec::new(); @@ -379,7 +385,7 @@ pub fn walk_expr( }); non_init.clone().iter().cloned().fold( threaded_accum.clone(), - |acc: Rc, a: Rc| { + |acc: _, a: Rc| { walk_expr(acc, arg_value(a.clone()), false, si.clone()) }, ) @@ -387,7 +393,7 @@ pub fn walk_expr( } else { texpr.children.clone().iter().cloned().fold( accum.clone(), - |acc: Rc, a: Rc| { + |acc: _, a: Rc| { walk_expr(acc, arg_value(a.clone()), false, si.clone()) }, ) @@ -449,7 +455,7 @@ pub fn walk_expr( }); let walked = non_init.clone().iter().cloned().fold( threaded_accum.clone(), - |acc: Rc, a: Rc| { + |acc: _, a: Rc| { walk_expr(acc, arg_value(a.clone()), false, si.clone()) }, ); @@ -467,7 +473,7 @@ pub fn walk_expr( let recv_accum = walk_expr(accum.clone(), recv.clone(), false, si.clone()); mc_args.clone().iter().cloned().fold( recv_accum.clone(), - |acc: Rc, a: Rc| { + |acc: _, a: Rc| { walk_expr(acc, arg_value(a.clone()), false, si.clone()) }, ) @@ -546,7 +552,7 @@ pub fn walk_expr( .cloned() .fold( accum.clone(), - |acc: Rc, p: (i64, Rc)| { + |acc: _, p: (i64, Rc)| { walk_expr(acc, p.1.clone(), false, si.clone()) }, ); @@ -562,31 +568,30 @@ pub fn walk_expr( } } } - ExprData::ExprReturn => texpr.children.clone().iter().cloned().fold( - accum.clone(), - |acc: Rc, child: Rc| { + ExprData::ExprReturn => texpr + .children + .clone() + .iter() + .cloned() + .fold(accum.clone(), |acc: _, child: Rc| { walk_expr(acc, child.clone(), true, si.clone()) - }, - ), + }), ExprData::ExprLambda => { let body = lambda_body(texpr.clone()); let inner = walk_expr(empty_usage_accum(), body.clone(), false, si.clone()); let binding_merged = Rc::new(v1_rt::map_values(&inner.bindings.clone())) .iter() .cloned() - .fold( - accum.clone(), - |acc: Rc, usage: Rc| { - record_use( - acc, - usage.name.clone(), - EdgeKind::Read, - "lambda-capture".to_string(), - None, - 0, - ) - }, - ); + .fold(accum.clone(), |acc: _, usage: _| { + record_use( + acc, + usage.name.clone(), + EdgeKind::Read, + "lambda-capture".to_string(), + None, + 0, + ) + }); Rc::new(UsageAccum { bindings: binding_merged.bindings.clone(), fold_call_nodes: v1_rt::concat( @@ -604,19 +609,16 @@ pub fn walk_expr( let binding_merged = Rc::new(v1_rt::map_values(&inner.bindings.clone())) .iter() .cloned() - .fold( - coll_accum.clone(), - |acc: Rc, usage: Rc| { - record_use( - acc, - usage.name.clone(), - EdgeKind::Read, - "foreach-capture".to_string(), - None, - 0, - ) - }, - ); + .fold(coll_accum.clone(), |acc: _, usage: _| { + record_use( + acc, + usage.name.clone(), + EdgeKind::Read, + "foreach-capture".to_string(), + None, + 0, + ) + }); Rc::new(UsageAccum { bindings: binding_merged.bindings.clone(), fold_call_nodes: v1_rt::concat( @@ -626,12 +628,14 @@ pub fn walk_expr( touched: binding_merged.touched.clone(), }) } - _ => texpr.children.clone().iter().cloned().fold( - accum.clone(), - |acc: Rc, child: Rc| { + _ => texpr + .children + .clone() + .iter() + .cloned() + .fold(accum.clone(), |acc: _, child: Rc| { walk_expr(acc, child.clone(), false, si.clone()) - }, - ), + }), } }) } @@ -752,9 +756,7 @@ pub fn build_movable_set( .cloned() .fold( v1_rt::rc_empty_set::(), - |acc: Rc>, usage: Rc| { - v1_rt::rc_set_insert(acc, usage.name.clone()) - }, + |acc: Rc>, usage: _| v1_rt::rc_set_insert(acc, usage.name.clone()), ) } @@ -796,9 +798,7 @@ pub fn build_read_only_params( .cloned() .fold( v1_rt::rc_empty_set::(), - |acc: Rc>, usage: Rc| { - v1_rt::rc_set_insert(acc, usage.name.clone()) - }, + |acc: Rc>, usage: _| v1_rt::rc_set_insert(acc, usage.name.clone()), ) } @@ -1239,28 +1239,30 @@ pub fn analyze_ownership( si: Rc>>, ) -> Rc { { - let initial = params.clone().iter().cloned().fold( - empty_usage_accum(), - |acc: Rc, p: Rc| { - let acc = v1_rt::take_owned(acc); - { - let p_name = authored_name_at(si.clone(), p.clone()); - Rc::new(UsageAccum { - bindings: v1_rt::rc_map_insert( - acc.bindings, - p_name.clone(), - Rc::new(BindingUsage { - name: p_name.clone(), - binding_kind: None, - consumers: Rc::new(vec![]), - }), - ), - fold_call_nodes: acc.fold_call_nodes, - touched: acc.touched, - }) - } - }, - ); + let initial = + params + .clone() + .iter() + .cloned() + .fold(empty_usage_accum(), |acc: _, p: Rc| { + let acc = v1_rt::take_owned(acc); + { + let p_name = authored_name_at(si.clone(), p.clone()); + Rc::new(UsageAccum { + bindings: v1_rt::rc_map_insert( + acc.bindings, + p_name.clone(), + Rc::new(BindingUsage { + name: p_name.clone(), + binding_kind: None, + consumers: Rc::new(vec![]), + }), + ), + fold_call_nodes: acc.fold_call_nodes, + touched: acc.touched, + }) + } + }); let result = walk_expr(initial.clone(), body.clone(), true, si.clone()); let binding_list = Rc::new(v1_rt::map_values(&result.bindings.clone())); let decisions = Rc::new({ diff --git a/src/v1/stage0/src/v1_compiler_parse.rs b/src/v1/stage0/src/v1_compiler_parse.rs index b2fd2971651..8916a700bd1 100644 --- a/src/v1/stage0/src/v1_compiler_parse.rs +++ b/src/v1/stage0/src/v1_compiler_parse.rs @@ -2251,7 +2251,7 @@ pub fn stamp_parsed_node_list( nodes: Rc::new(vec![]), ctx: ctx.clone(), }), - |acc: Rc, node: Rc| { + |acc: _, node: Rc| { let acc = v1_rt::take_owned(acc); { let stamped = diff --git a/src/v1/stage0/src/v1_compiler_resolve.rs b/src/v1/stage0/src/v1_compiler_resolve.rs index d1c18b3105a..e86b2a4cee4 100644 --- a/src/v1/stage0/src/v1_compiler_resolve.rs +++ b/src/v1/stage0/src/v1_compiler_resolve.rs @@ -133,7 +133,7 @@ pub fn resolve_modules_with_occurrence_transport( imports_by_name: v1_rt::rc_empty_map::>>>(), diagnostics: Rc::new(vec![]), }), - |acc: Rc, m: Rc| { + |acc: _, m: Rc| { let acc = v1_rt::take_owned(acc); { let result = resolve_module_imports( @@ -513,7 +513,7 @@ pub fn check_duplicate_modules( seen_names: v1_rt::rc_empty_map::(), diagnostics: Rc::new(vec![]), }), - |state: Rc, m: Rc| { + |state: _, m: Rc| { let m_name = authored_name_at(source_indices.clone(), m.clone()); let is_dup = v1_rt::map_has(&state.seen_names.clone(), m_name.clone()); if is_dup.clone() { diff --git a/src/v1/stage0/src/v1_std_core.rs b/src/v1/stage0/src/v1_std_core.rs index 79e1a32057b..cd6b154b3cf 100644 --- a/src/v1/stage0/src/v1_std_core.rs +++ b/src/v1/stage0/src/v1_std_core.rs @@ -26,7 +26,7 @@ pub use crate::std_induction::SubValueRelation; use crate::std_induction::SubValueRelation::*; use crate::std_occurrence_identity::OccurrenceTransportRefusal::{ DuplicateAuthoredOccurrenceIdentity, InconsistentOccurrenceContainment, - MissingAuthoredOccurrenceIdentity, WrongOccurrenceCategory, + MissingAuthoredOccurrenceIdentity, UnknownOccurrenceIdentity, WrongOccurrenceCategory, }; pub use crate::std_occurrence_identity::{ authored_token_ordinal_space_from_allocator, authored_token_ordinal_space_initial, @@ -476,26 +476,36 @@ pub struct ErrorDAG { pub errors: Rc>>, } +pub fn occurrence_transport_refusal_span_absence_note() -> String { + thread_local! { + static CACHED: String = { + "Span absence for OccurrenceTransportRefusal is decided HERE, by a total wildcard-free match, and rendered by diagnostic_to_span as no_span() -- the corpus's single authority for 'no authored location' (review 45364).\n\nWHY THERE IS NO SPAN TO CARRY: UnknownOccurrenceIdentity is raised when an OccurrenceId is in neither entries_by_id nor references_by_id (std.occurrence_binding_resolve resolve_reference_occurrence_binding_validated). resolve_reference_occurrence_binding takes ONLY an OccurrenceId (review 45106) precisely so caller-supplied span facts cannot bypass the validated carrier, so at that point no authored span exists to report. This is absence by construction, not a failure to compute one.\n\nWHAT WAS DELETED AND WHY: this arm previously minted two placeholder SourceSpans -- file '' and a wildcard ''. Both are removed. The wildcard was the DESIGN section 5 absorbing arm: a future spanless variant would have been absorbed into an anonymous placeholder instead of stopping the line. It is now unreachable-by-construction rather than merely unused, because adding a variant reds the total match below AND the total match in occurrence_transport_refusal_diagnostic_message. The '' file name was additionally a section 2 duplicate: the occurrence id is already carried by occurrence_transport_refusal_diagnostic_message, so the span restated a fact the message owns, and a bespoke pseudo-file was a section 3 nickname for no_span().\n\nBOUND, STATED HONESTLY: diagnostic_to_span returns SourceSpan, not SourceSpan?, so span-absence is rendered rather than typed at that boundary. Making it typed changes a load-bearing v1 seed signature with 3 dag and 24 Rust call sites and is a separate corpus-wide change, not this node's scope. Until then no_span() is the honest rendering and the message carries the identity.".to_string() + }; + } + CACHED.with(|c: &String| c.clone()) +} + pub fn occurrence_transport_refusal_diagnostic_span( refusal: Rc, -) -> Rc { +) -> Option> { match (*refusal.clone()).clone() { OccurrenceTransportRefusal::MissingAuthoredOccurrenceIdentity { diagnostic_span: span, .. - } => span.clone(), + } => Some(span.clone()), OccurrenceTransportRefusal::DuplicateAuthoredOccurrenceIdentity { diagnostic_span: span, .. - } => span.clone(), + } => Some(span.clone()), OccurrenceTransportRefusal::InconsistentOccurrenceContainment { diagnostic_span: span, .. - } => span.clone(), + } => Some(span.clone()), OccurrenceTransportRefusal::WrongOccurrenceCategory { diagnostic_span: span, .. - } => span.clone(), + } => Some(span.clone()), + OccurrenceTransportRefusal::UnknownOccurrenceIdentity { occurrence: _, .. } => None, } } @@ -507,6 +517,7 @@ pub fn occurrence_transport_refusal_diagnostic_message( OccurrenceTransportRefusal::DuplicateAuthoredOccurrenceIdentity { occurrence, .. } => v1_rt::concat("occurrence transport refused: duplicate authored occurrence identity ".to_string(), (occurrence.value.clone()).to_string()), OccurrenceTransportRefusal::InconsistentOccurrenceContainment { occurrence, .. } => v1_rt::concat("occurrence transport refused: inconsistent containment for authored occurrence identity ".to_string(), (occurrence.value.clone()).to_string()), OccurrenceTransportRefusal::WrongOccurrenceCategory { occurrence, .. } => v1_rt::concat("occurrence transport refused: wrong category for authored occurrence identity ".to_string(), (occurrence.value.clone()).to_string()), + OccurrenceTransportRefusal::UnknownOccurrenceIdentity { occurrence: occurrence, .. } => v1_rt::concat("occurrence transport refused: unknown occurrence identity ".to_string(), (occurrence.value.clone()).to_string()), } } @@ -535,7 +546,10 @@ pub fn diagnostic_to_span(d: Rc) -> Rc { CompilerDiagnostic::AmbiguousReference { span: s, .. } => s.clone(), CompilerDiagnostic::OccurrenceTransportViolation { refusal: refusal, .. - } => occurrence_transport_refusal_diagnostic_span(refusal.clone()), + } => match occurrence_transport_refusal_diagnostic_span(refusal.clone()) { + Some(span) => span.clone(), + None => no_span(), + }, } } diff --git a/src/v1/stage0/src/v1_tests_claim_pattern_binder_declaration_node_test.rs b/src/v1/stage0/src/v1_tests_claim_pattern_binder_declaration_node_test.rs index 8b4cce408c5..5d3e7a0a60d 100644 --- a/src/v1/stage0/src/v1_tests_claim_pattern_binder_declaration_node_test.rs +++ b/src/v1/stage0/src/v1_tests_claim_pattern_binder_declaration_node_test.rs @@ -189,75 +189,89 @@ pub fn occurrence_index_has_name( occurrence: OccurrenceId, name: String, ) -> bool { - index.entries.clone().iter().cloned().fold( - false, - |found: bool, entry: Rc| { + index + .entries + .clone() + .iter() + .cloned() + .fold(false, |found: bool, entry: _| { (found || ((entry.projection.clone().occurrence.clone().value.clone() == occurrence.value.clone()) && (entry.projection.clone().authored_name.clone() == name.clone()))) - }, - ) + }) } pub fn lexical_declaration_count_named(transport: Rc, name: String) -> i64 { - transport.declarations.clone().iter().cloned().fold( - 0, - |total: i64, declaration: Rc| match declaration.category.clone() { - OccurrenceCategory::LexicalValueOccurrence => { - if occurrence_index_has_name( - transport.index.clone(), - declaration.occurrence.clone(), - name.clone(), - ) { - (total.clone() + 1) - } else { - total.clone() + transport + .declarations + .clone() + .iter() + .cloned() + .fold(0, |total: i64, declaration: _| { + match declaration.category.clone() { + OccurrenceCategory::LexicalValueOccurrence => { + if occurrence_index_has_name( + transport.index.clone(), + declaration.occurrence.clone(), + name.clone(), + ) { + (total.clone() + 1) + } else { + total.clone() + } } + _ => total.clone(), } - _ => total.clone(), - }, - ) + }) } pub fn lexical_reference_count_named(transport: Rc, name: String) -> i64 { - transport.references.clone().iter().cloned().fold( - 0, - |total: i64, reference: Rc| match reference.category.clone() { - OccurrenceCategory::LexicalValueOccurrence => { - if occurrence_index_has_name( - transport.index.clone(), - reference.occurrence.clone(), - name.clone(), - ) { - (total.clone() + 1) - } else { - total.clone() + transport + .references + .clone() + .iter() + .cloned() + .fold(0, |total: i64, reference: _| { + match reference.category.clone() { + OccurrenceCategory::LexicalValueOccurrence => { + if occurrence_index_has_name( + transport.index.clone(), + reference.occurrence.clone(), + name.clone(), + ) { + (total.clone() + 1) + } else { + total.clone() + } } + _ => total.clone(), } - _ => total.clone(), - }, - ) + }) } pub fn type_reference_count_named(transport: Rc, name: String) -> i64 { - transport.references.clone().iter().cloned().fold( - 0, - |total: i64, reference: Rc| match reference.category.clone() { - OccurrenceCategory::TypeOccurrence => { - if occurrence_index_has_name( - transport.index.clone(), - reference.occurrence.clone(), - name.clone(), - ) { - (total.clone() + 1) - } else { - total.clone() + transport + .references + .clone() + .iter() + .cloned() + .fold(0, |total: i64, reference: _| { + match reference.category.clone() { + OccurrenceCategory::TypeOccurrence => { + if occurrence_index_has_name( + transport.index.clone(), + reference.occurrence.clone(), + name.clone(), + ) { + (total.clone() + 1) + } else { + total.clone() + } } + _ => total.clone(), } - _ => total.clone(), - }, - ) + }) } pub fn w_pattern_parser_materializes_dedicated_declaration_nodes() -> bool { @@ -385,7 +399,7 @@ pub fn w_sequential_parse_uses_disjoint_authored_token_ordinal_ranges() -> bool .clone() .iter() .cloned() - .fold(true, |outer_ok: bool, left: Rc| { + .fold(true, |outer_ok: bool, left: _| { (outer_ok && second .occurrence_transport @@ -396,7 +410,7 @@ pub fn w_sequential_parse_uses_disjoint_authored_token_ordinal_ranges() -> bool .clone() .iter() .cloned() - .fold(true, |inner_ok: bool, right: Rc| { + .fold(true, |inner_ok: bool, right: _| { (inner_ok && (left.projection.clone().occurrence.clone().value.clone() != right.projection.clone().occurrence.clone().value.clone())) @@ -411,7 +425,7 @@ pub fn w_sequential_parse_uses_disjoint_authored_token_ordinal_ranges() -> bool .clone() .iter() .cloned() - .fold(true, |ok: bool, entry: Rc| { + .fold(true, |ok: bool, entry: _| { (ok && (entry.projection.clone().occurrence.clone().value.clone() >= first.occurrence_allocator.clone().next_id.clone())) }); diff --git a/src/v1/tests/src/namespace_unique_on_chain_policy_test.rs b/src/v1/tests/src/namespace_unique_on_chain_policy_test.rs index 3cf089403e5..e509340eacf 100644 --- a/src/v1/tests/src/namespace_unique_on_chain_policy_test.rs +++ b/src/v1/tests/src/namespace_unique_on_chain_policy_test.rs @@ -1,27 +1,23 @@ -//! §8-step-4 discriminating witness (namespace-resolution-design.md §13, operator-ratified -//! 2026-07-21): the executing v1 seed resolver carries a NameResolutionPolicy gate — -//! default ON = NamespaceOnlyY strict unique-on-chain with typed `AmbiguousReference` -//! refusals, OFF (host-bracketed) = ImportScoped (nearest-wins / first-hit, byte-for-byte). -//! -//! The homonym fixtures below are the discriminating inputs: the SAME sources compile -//! clean under ImportScoped and refuse (typed, located, full candidate list) under -//! NamespaceOnlyY — on both the type/value path (ancestor-chain homonym resolved by -//! nearest-wins today) and the fn path (first-hit over `func_env.parents`, the -//! `fn_parent_first_hit` silent-pick class, which had NO refusal arm at all). -//! Controls pin the boundary: a chain-unique homonym still resolves under the strict -//! policy, and a genuinely-unbound name stays `UnresolvedType` — the refusal is typed, -//! never a blanket. +//! Canonical binding witness (namespace-canonical-binding / namespace-resolution-design.md §13): +//! production global-bare and fn-parent cardinality always routes through the one +//! `module_path_owner_binding_decide` fold on chain-filtered populations — no policy +//! bracket may re-enable nearest-wins or first-hit silent picks on these paths +//! (roadmap `namespace-canonical-binding` out_of_scope: no configuration switch). use std::rc::Rc; +use v1_compiler::cli_run::{containment_resolve_fn_v1_for_module, ContainmentResolve}; +use v1_compiler::std_occurrence_identity::{OccurrenceId, OccurrenceTransportRefusal}; use v1_compiler::v1_compiler_compile::{compile_to_resolved, SourceFile}; use v1_compiler::v1_rt::{ name_resolution_policy_is_namespace_only, name_resolution_policy_set_namespace_only, }; -use v1_compiler::v1_std_core::{diagnostic_to_message, is_error_diagnostic}; +use v1_compiler::v1_std_core::{ + diagnostic_to_message, diagnostic_to_span, is_error_diagnostic, no_span, CompilerDiagnostic, +}; -/// Panic-safe policy bracket: save/restore the thread-local gate so ImportScoped cases -/// bracket `false` explicitly and drop always restores the pre-test default. +/// Panic-safe policy bracket: retained only to prove the host gate no longer bypasses +/// canonical binding on the production paths this PR routes. struct ResolutionPolicyGuard(bool); impl ResolutionPolicyGuard { @@ -55,12 +51,9 @@ fn error_diag_messages(sources: Vec>) -> Vec { .collect() } -/// Chain homonym on BOTH paths. `fixchain` and `fixchain.mid` are both ancestors of the -/// referencing module `fixchain.mid.leaf`: -/// - type/value path: bare `Homonym` — ImportScoped resolves nearest (`fixchain.mid`), -/// NamespaceOnlyY sees 2 binders on the chain and refuses; -/// - fn path: bare `pick()` with two glob imports both providing it — ImportScoped -/// first-hits over the flat parent closure, NamespaceOnlyY refuses on 2 matches. +/// Chain homonym on BOTH paths under `fixchain.mid.leaf`: +/// - type/value path: bare `Homonym` — 2 binders on the chain → AmbiguousReference; +/// - fn path: bare `pick()` with two glob imports → AmbiguousReference. fn homonym_fixture() -> Vec> { vec![ src( @@ -86,9 +79,6 @@ fn homonym_fixture() -> Vec> { ] } -/// Control fixture: homonym whose candidates put EXACTLY ONE binder on the referencing -/// chain (`Duo` in ancestor `fixchain.mid` vs non-ancestor `fixother`) — must resolve -/// under BOTH policies (the strict rule is unique-on-chain, not no-homonyms-anywhere). fn unique_on_chain_fixture() -> Vec> { vec![ src( @@ -103,11 +93,6 @@ fn unique_on_chain_fixture() -> Vec> { ] } -/// Control fixture: whole-pool homonym with ZERO binders on the referencing chain -/// (`Stray` declared only in two non-ancestor siblings). ImportScoped already refuses -/// (all-disjoint LCP tie) as `UnresolvedType`; NamespaceOnlyY refuses as the honest -/// `AmbiguousReference` with the full pool — mirroring the census containment walk -/// (lexical Unbound + whole-pool-ambiguous => Ambiguous, never a fabricated bind). fn zero_on_chain_fixture() -> Vec> { vec![ src("fixother.dag", "module fixother\ntype Stray { a: Int }\n"), @@ -119,7 +104,16 @@ fn zero_on_chain_fixture() -> Vec> { ] } -/// Control fixture: a genuinely-unbound name (declared nowhere). +fn single_off_chain_unique_fixture() -> Vec> { + vec![ + src("fixother.dag", "module fixother\ntype Solo { a: Int }\n"), + src( + "leaf.dag", + "module fixchain.mid.leaf\nfn use_solo(x: Solo) -> Solo { x }\n", + ), + ] +} + fn unbound_fixture() -> Vec> { vec![src( "leaf.dag", @@ -128,18 +122,23 @@ fn unbound_fixture() -> Vec> { } #[test] -fn import_scoped_default_resolves_homonym_fixture_clean() { +fn policy_bracket_does_not_bypass_canonical_homonym_refusal() { let _guard = ResolutionPolicyGuard::set(false); let diags = error_diag_messages(homonym_fixture()); assert!( - diags.is_empty(), - "ImportScoped policy (host bracket false) must preserve today's behavior verbatim \ - (nearest-wins type resolution + first-hit fn resolution); got {diags:?}" + diags.iter().any(|m| m.contains("ambiguous reference 'Homonym'")), + "host policy bracket false must not restore nearest-wins for on-chain homonyms; got {diags:?}" + ); + assert!( + diags + .iter() + .any(|m| m.contains("ambiguous reference 'pick'")), + "host policy bracket false must not restore first-hit fn resolution; got {diags:?}" ); } #[test] -fn namespace_only_refuses_chain_homonym_on_type_path() { +fn canonical_refuses_chain_homonym_on_type_path() { let _guard = ResolutionPolicyGuard::set(true); let diags = error_diag_messages(homonym_fixture()); let homonym_refusals: Vec<&String> = diags @@ -148,18 +147,17 @@ fn namespace_only_refuses_chain_homonym_on_type_path() { .collect(); assert!( !homonym_refusals.is_empty(), - "NamespaceOnlyY must refuse the 2-binders-on-chain type homonym with a typed \ - AmbiguousReference; got {diags:?}" + "2-binders-on-chain type homonym must refuse with AmbiguousReference; got {diags:?}" ); let listing = homonym_refusals[0]; assert!( listing.contains("fixchain.Homonym") && listing.contains("fixchain.mid.Homonym"), - "the refusal must carry the FULL candidate list (fix menu, §13); got {listing}" + "the refusal must carry the FULL candidate list; got {listing}" ); } #[test] -fn namespace_only_refuses_fn_parent_homonym_at_call_site() { +fn canonical_refuses_fn_parent_homonym_at_call_site() { let _guard = ResolutionPolicyGuard::set(true); let diags = error_diag_messages(homonym_fixture()); let pick_refusals: Vec<&String> = diags @@ -168,8 +166,7 @@ fn namespace_only_refuses_fn_parent_homonym_at_call_site() { .collect(); assert!( !pick_refusals.is_empty(), - "NamespaceOnlyY must refuse the 2-parent-matches fn homonym (the \ - fn_parent_first_hit silent-pick class) with a typed AmbiguousReference; got {diags:?}" + "2-parent-matches fn homonym must refuse with AmbiguousReference; got {diags:?}" ); let listing = pick_refusals[0]; assert!( @@ -179,66 +176,173 @@ fn namespace_only_refuses_fn_parent_homonym_at_call_site() { } #[test] -fn namespace_only_unique_on_chain_still_resolves() { +fn unique_on_chain_still_resolves() { let _guard = ResolutionPolicyGuard::set(true); let diags = error_diag_messages(unique_on_chain_fixture()); assert!( diags.is_empty(), - "exactly-one-binder-on-chain must RESOLVE under NamespaceOnlyY (the strict rule \ - is unique-on-chain, not no-homonyms-anywhere); got {diags:?}" + "exactly-one-binder-on-chain must resolve; got {diags:?}" ); } #[test] -fn zero_on_chain_homonym_discriminates_the_diagnostic_label() { - let import_scoped = { - let _guard = ResolutionPolicyGuard::set(false); - error_diag_messages(zero_on_chain_fixture()) - }; - assert!( - import_scoped - .iter() - .any(|m| m.contains("unresolved type 'Stray'")), - "ImportScoped all-disjoint LCP tie refuses as UnresolvedType today; got {import_scoped:?}" +fn zero_on_chain_homonym_is_unresolved_not_ambiguous() { + for namespace_only in [false, true] { + let _guard = ResolutionPolicyGuard::set(namespace_only); + let diags = error_diag_messages(zero_on_chain_fixture()); + assert!( + diags.iter().any(|m| m.contains("unresolved type 'Stray'")), + "zero on-chain homonym must be UnresolvedType (policy={namespace_only}); got {diags:?}" + ); + assert!( + !diags.iter().any(|m| m.contains("ambiguous")), + "zero on-chain must not widen to AmbiguousReference (policy={namespace_only}); got {diags:?}" + ); + } +} + +#[test] +fn zero_on_chain_containment_census_matches_inference_unresolved() { + let _guard = ResolutionPolicyGuard::set(true); + let sources = zero_on_chain_fixture(); + let resolved = compile_to_resolved(Rc::new(sources.into())); + let graph = resolved.graph.as_ref().expect("graph"); + let leaf = graph + .modules + .iter() + .find(|m| m.type_env.module_path == "fixchain.mid.leaf") + .expect("leaf module"); + let containment = containment_resolve_fn_v1_for_module( + &leaf.type_env.symbol_index, + "fixchain.mid.leaf", + "Stray", + None, ); assert!( - !import_scoped.iter().any(|m| m.contains("ambiguous")), - "ImportScoped bracket must not mint AmbiguousReference; got {import_scoped:?}" + matches!(containment, ContainmentResolve::Unresolved), + "containment census must mirror inference for zero on-chain homonym; got {containment:?}" ); +} - let strict = { - let _guard = ResolutionPolicyGuard::set(true); - error_diag_messages(zero_on_chain_fixture()) - }; - let stray: Vec<&String> = strict +#[test] +fn single_off_chain_unique_refuses_regardless_of_policy_bracket() { + for namespace_only in [false, true] { + let _guard = ResolutionPolicyGuard::set(namespace_only); + let diags = error_diag_messages(single_off_chain_unique_fixture()); + assert!( + diags.iter().any(|m| m.contains("unresolved type 'Solo'")), + "corpus-unique off-chain name must refuse as UnresolvedType (policy={namespace_only}); got {diags:?}" + ); + assert!( + !diags.iter().any(|m| m.contains("ambiguous")), + "single off-chain candidate is Unresolved, not Ambiguous (policy={namespace_only}); got {diags:?}" + ); + } +} + +#[test] +fn single_off_chain_unique_containment_census_matches_inference() { + let _guard = ResolutionPolicyGuard::set(true); + let sources = single_off_chain_unique_fixture(); + let resolved = compile_to_resolved(Rc::new(sources.into())); + let graph = resolved.graph.as_ref().expect("graph"); + let leaf = graph + .modules .iter() - .filter(|m| m.contains("ambiguous reference 'Stray'")) - .collect(); - assert!( - !stray.is_empty(), - "NamespaceOnlyY labels the zero-on-chain whole-pool homonym honestly as \ - Ambiguous (census walk parity), never a mislabeled UnresolvedType; got {strict:?}" + .find(|m| m.type_env.module_path == "fixchain.mid.leaf") + .expect("leaf module"); + let containment = containment_resolve_fn_v1_for_module( + &leaf.type_env.symbol_index, + "fixchain.mid.leaf", + "Solo", + None, ); assert!( - stray[0].contains("fixother.Stray") && stray[0].contains("fixother2.Stray"), - "the refusal must carry the full pool candidate list; got {}", - stray[0] + matches!(containment, ContainmentResolve::Unresolved), + "containment census must mirror inference for corpus-unique off-chain name; got {containment:?}" ); } #[test] -fn namespace_only_keeps_genuinely_unbound_as_unresolved_not_ambiguous() { +fn genuinely_unbound_stays_unresolved_not_ambiguous() { let _guard = ResolutionPolicyGuard::set(true); let diags = error_diag_messages(unbound_fixture()); assert!( diags .iter() .any(|m| m.contains("unresolved type 'NoSuchTypeAnywhere'")), - "a name bound NOWHERE stays UnresolvedType under the strict policy \ - (Ambiguous and Unresolved are distinct states, §5); got {diags:?}" + "unbound name stays UnresolvedType; got {diags:?}" ); assert!( !diags.iter().any(|m| m.contains("ambiguous")), "no fabricated ambiguity for an unbound name; got {diags:?}" ); } + +/// `UnknownOccurrenceIdentity` is the one refusal in the transport that carries no +/// authored span (the id is in neither index, so none exists — absence by construction). +/// It must render through the corpus's single no-location authority, `no_span()`, and +/// must NOT launder the occurrence id into a minted pseudo-file (review 45364). +/// +/// Discriminating: this goes RED if the `` placeholder is +/// reintroduced, because the assertions below reject any span whose file names the id. +#[test] +fn unknown_occurrence_refusal_renders_no_span_never_a_minted_pseudo_file() { + let diagnostic = Rc::new(CompilerDiagnostic::OccurrenceTransportViolation { + refusal: Rc::new(OccurrenceTransportRefusal::UnknownOccurrenceIdentity { + occurrence: OccurrenceId { value: 4926 }, + }), + }); + + let span = diagnostic_to_span(diagnostic.clone()); + + assert_eq!( + span, + no_span(), + "spanless refusal must render as the single no-location authority" + ); + assert!( + !span.file.contains("4926"), + "span fabricated the occurrence id into a file name: {}", + span.file + ); + assert!( + !span.file.contains("unknown-occurrence"), + "span minted a placeholder file name: {}", + span.file + ); + + // The identity is not lost — the message owns it, and is its only carrier. + assert!( + diagnostic_to_message(diagnostic).contains("4926"), + "occurrence identity must still be reported, via the message" + ); +} + +/// Span-carrying refusals are unaffected: they still report their authored location, +/// so the fix above removed a fabrication rather than flattening real spans to nothing. +#[test] +fn span_carrying_refusal_still_reports_its_authored_span() { + let authored = v1_compiler::std_types::SourceSpan { + file: "dag/std/occurrence_identity.dag".to_string(), + start: 120, + end: 148, + }; + let diagnostic = Rc::new(CompilerDiagnostic::OccurrenceTransportViolation { + refusal: Rc::new( + OccurrenceTransportRefusal::DuplicateAuthoredOccurrenceIdentity { + occurrence: OccurrenceId { value: 7 }, + diagnostic_span: Rc::new(authored.clone()), + }, + ), + }); + + let span = diagnostic_to_span(diagnostic); + + assert_eq!(*span, authored, "authored spans must survive unchanged"); + assert_ne!( + *span, + *no_span(), + "a real span must not collapse to no_span" + ); +} diff --git a/src/v2/compiler/body_producer_forward.dag b/src/v2/compiler/body_producer_forward.dag index 96597a88c99..0dfb9ccf803 100644 --- a/src/v2/compiler/body_producer_forward.dag +++ b/src/v2/compiler/body_producer_forward.dag @@ -1,5 +1,43 @@ module v2.compiler.body_producer_forward +import std.algebra { Cons, Empty } +import v2.std.algebra { fold_list, length, list_append } +import v2.std.collection { + List, +} +import v2.std.optional { + Absent, + Optional, + Present, + optional_absent, + optional_present, +} +import v2.std.diagnostic { + Accepted, + Diagnostic, + ExternalContractUnknown, + Outcome, + Rejected, + Unavailable, + node_locus, +} +import v2.extdeps.languages.dag { + dag_translation_rules_node, + parse_production_emitted_identity_optional, +} +import v2.std.grammar { grammar_relation_row_forward_production_selection } +import v2.std.node { + Atom, + Arrow, + ComputationNode, + Node, + Symbol, + TypeNode, + node_synthetic, +} +import v2.std.logic { Bool } +import v2.std.text { Int } + data body_producer_forward_note: String = "General body producer forward fold (general-body-producer-design §3, wave2_prep_design §3): production-identity-keyed GrammarRelationRow selection at the normalize/body-producer seam — the forward reading of the same rows the emitter reads backward. First consumer of ObligationForwardDeterminism (exactly-one row per surface identity) and the production-identity selection helper grammar_relation_row_forward_production_selection. Behavior lowering (match/if/let/loop/…) dispatches through body_lower_fold in v2.compiler.body_lowering_fold until Slice 4 deletes that interim module wholesale. dissolve-on: body_lowering_fold.dag absent — this module owns the full forward slot-map apply." type BodyProducerForwardRow { diff --git a/src/v2/compiler/program_assembly.dag b/src/v2/compiler/program_assembly.dag index 4090e1e61c0..03c1666067e 100644 --- a/src/v2/compiler/program_assembly.dag +++ b/src/v2/compiler/program_assembly.dag @@ -1,6 +1,42 @@ module v2.compiler.program_assembly +import v2.compiler.name_resolve { + Admission, + resolve_with_admission, + resolve_with_admission_grounded, + validate_module_roots +} +import v2.compiler.normalize { normalize } +import v2.compiler.parse { PreparedGrammar, parse_module, parse_module_prepared, prepare_grammar } +import v2.compiler.source_authority { + DagSourceReadWitness, + SourceRootIngest, + source_authority_diagnostic, + source_root_set_from_ingest +} +import v2.compiler.tokenize { tokenize } import v2.extdeps.languages.dag { qualified_name_from_module_node } +import v2.std.cross_tree.resolution { + SourceRootIndex, + source_root_index_empty, + source_root_index_insert +} +import v2.std.language_model { LanguageModel } +import std.algebra { Empty, FreeMonoid } +import v2.std.algebra { fold_list, list_snoc_item } +import v2.std.artifact { SourceFile } +import v2.std.diagnostic { + Accepted, + Diagnostics, + NonEmptyDiagnostics, + None, + Outcome, + Rejected, + bind_outcome, + outcome_accepted, + outcome_rejected +} +import v2.std.node { Node } type ProgramAssemblyFoldState = ProgramAssemblyFoldOk { diff --git a/src/v2/extdeps/languages/rust_wire_serde.dag b/src/v2/extdeps/languages/rust_wire_serde.dag index 8c8c5f25f44..5a8c78f1f9f 100644 --- a/src/v2/extdeps/languages/rust_wire_serde.dag +++ b/src/v2/extdeps/languages/rust_wire_serde.dag @@ -1,5 +1,53 @@ module v2.extdeps.languages.rust_wire_serde +import std.serialization { + VariantNaming, + AsAuthored, + SnakeCase, + ScreamingSnakeCase, + StripPrefixAndSnakeCase, + StripSuffixAndSnakeCase, + StripPrefixSuffixAndSnakeCase +} +import extdeps.languages.rust.emit { + rust_serde_rename_all_snake_case, + rust_serde_rename_all_screaming_snake_case +} +import v2.extdeps.languages.rust { + rust_concrete_token_node, + rust_inhabitant_atom, + rust_named_edge, + rust_reference_layer_tokens +} +import v2.std.algebra { fold_list } +import v2.std.collection { List, empty_map } +import v2.std.compilers.lexing { + LexRule, + LexRuleSet, + LexRules, + LiteralPattern, + ModeledLexRules, + TokenRule +} +import v2.std.compilers.target_model { + ConcreteSyntaxToken, + FixedToken, + TargetModel, + concrete_syntax_token_class, + target_reference_layer_tokens_node +} +import v2.std.grammar { + GrammarExpr, + GrammarProduction, + Sequence, + StampClass, + Terminal, + grammar_production_to_node, + grammar_relation_tokens_node +} +import v2.std.host_transport { target_emit_host_runtime_row_unconfigured } +import v2.std.node { Arrow, Atom, Conj, Edge, Node, Positional, Symbol, SyntheticOccurrence, TypeNode } + fn rust_wire_serde_string_variant_rename_all_attr(naming: VariantNaming) -> String { match naming { AsAuthored => "" diff --git a/src/v2/lens/affected_set/closure_deep_chain.dag b/src/v2/lens/affected_set/closure_deep_chain.dag index 845d48342f3..20f0ffb2995 100644 --- a/src/v2/lens/affected_set/closure_deep_chain.dag +++ b/src/v2/lens/affected_set/closure_deep_chain.dag @@ -1,5 +1,12 @@ module v2.test.lens_affected_set.closure_deep_chain +import v2.std.node { Node, Edge, TypeNode, Atom, Named, SyntheticOccurrence } +import v2.std.dependency { DependencyView, dependency_lens, Contains } +import v2.std.algebra { contains } +import v2.lens.affected_set { affected_set_closure } +import v2.lens.affected_set_examples { affected_set_claim_failure_node } +import v2.test.lens_common.infer_fixture { claim_atom_node } + data closure_deep_chain_leaf: Node = claim_atom_node(s: ^closure_deep_chain_leaf_symbol) diff --git a/src/v2/lens/affected_set/closure_superset_safe.dag b/src/v2/lens/affected_set/closure_superset_safe.dag index 9120427f8e8..11c419403c4 100644 --- a/src/v2/lens/affected_set/closure_superset_safe.dag +++ b/src/v2/lens/affected_set/closure_superset_safe.dag @@ -1,5 +1,17 @@ module v2.test.lens_affected_set.closure_superset_safe +import v2.std.dependency { DependencyView, Contains } +import v2.std.algebra { contains, for_all } +import v2.lens.affected_set { affected_set_closure, AffectedSetClosureAcc } +import v2.lens.affected_set_examples { affected_set_claim_failure_node } +import v2.test.lens_affected_set.closure_deep_chain { + closure_deep_chain_root, + closure_deep_chain_n01, + closure_deep_chain_n02, + closure_deep_chain_n03, + closure_deep_chain_dependency_reading, +} + fn closure_frontier_node_eq(left: Node, right: Node) -> Bool { left == right diff --git a/src/v2/lens/affected_set/frontier_observation.dag b/src/v2/lens/affected_set/frontier_observation.dag index e9e0be1e350..9d16c3b6be1 100644 --- a/src/v2/lens/affected_set/frontier_observation.dag +++ b/src/v2/lens/affected_set/frontier_observation.dag @@ -1,5 +1,7 @@ module v2.test.lens_affected_set.frontier_observation +import v2.lens.affected_set { ExclusionKey, FrontierDecision, ReExecFrontier } + fn frontier_decision_matches(frontier: ReExecFrontier, key: ExclusionKey, expected: FrontierDecision) -> Bool { match frontier { diff --git a/src/v2/lens/affected_set/node_precision.dag b/src/v2/lens/affected_set/node_precision.dag index c39bc337b17..75038f77974 100644 --- a/src/v2/lens/affected_set/node_precision.dag +++ b/src/v2/lens/affected_set/node_precision.dag @@ -1,5 +1,17 @@ module v2.test.lens_affected_set.node_precision +import v2.compiler.infer { InferredFacts, InferredTree } +import v2.lens.affected_set { AffectedSetReading, FrontierDependency, affected_set_reading } +import v2.std.change { DependencyDependent, DependencySource } +import v2.std.dependency { Contains, DependencyView } +import v2.std.logic { Bool } +import v2.std.node { Atom, Edge, Named, Node, Symbol, TypeNode, SyntheticOccurrence } +import v2.test.lens_common.infer_fixture { + claim_atom_node, + claim_inferred_facts, + claim_inferred_tree +} + data affected_set_leaf: Node = claim_atom_node(s: ^affected_set_leaf_symbol) data affected_set_mid: Node = Node { diff --git a/src/v2/lens/affected_set/sg_claims_test.dag b/src/v2/lens/affected_set/sg_claims_test.dag index 9cb6350f4cf..3687192dfe3 100644 --- a/src/v2/lens/affected_set/sg_claims_test.dag +++ b/src/v2/lens/affected_set/sg_claims_test.dag @@ -1,6 +1,7 @@ module v2.test.lens_affected_set.sg_claims import v2.std.logic { Bool } +import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } import v2.test.lens_affected_set.fail_closed_pending_escalation { fail_closed_pending_escalation_claim_holds } diff --git a/src/v2/lens/application/serialize_applied_diff_swap_operands_test.dag b/src/v2/lens/application/serialize_applied_diff_swap_operands_test.dag index 3dd513752fe..bb4872893c5 100644 --- a/src/v2/lens/application/serialize_applied_diff_swap_operands_test.dag +++ b/src/v2/lens/application/serialize_applied_diff_swap_operands_test.dag @@ -1,5 +1,27 @@ module v2.test.lens_application.serialize_applied_diff_swap_operands +import v2.compiler.source_authority { deterministic_dag_source_serializer_witness } +import v2.compiler.translate { target_serialize_source_from_model } +import extdeps.communication.medium { Medium } +import v2.extdeps.languages.dag { + dag_fixture_emitted_add_fn, + dag_fixture_emitted_loop_fn, + dag_loop_arrow_with_body_wrong_value_fixture, + dag_loop_body_wrong_value_node, + dag_loop_target_model, + dag_target_model +} +import v2.lens.application { apply_diff } +import v2.lens.application_serializer { serialize_diff_as_source_patch } +import v2.std.compilers.target_model { TargetModel } +import v2.std.diagnostic { + Accepted, + Outcome, + Rejected +} +import v2.std.lens_verdict { Holds, Violates } +import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } +import v2.std.node { Diff, Edit, Path } data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly diff --git a/src/v2/lens/application_serializer.dag b/src/v2/lens/application_serializer.dag index 90f1a5b84c7..6dbeaae07ce 100644 --- a/src/v2/lens/application_serializer.dag +++ b/src/v2/lens/application_serializer.dag @@ -1,5 +1,14 @@ module v2.lens.application_serializer +import v2.compiler.translate { target_serialize_source_from_model } +import extdeps.communication.medium { Medium } +import v2.lens.application { apply_diff } +import v2.lens.common.construction_justification { ConstructionJustification, WallNow } +import std.decl_ref { DeclarationRef, WholeDeclaration } +import std.disposition { RealizationDispatch } +import v2.std.compilers.target_model { TargetModel } +import v2.std.diagnostic { Outcome, bind_outcome, outcome_accepted } +import v2.std.node { Diff, Node } type DagSourcePatch { before: Medium diff --git a/src/v2/lens/complexity_accumulator_copy/analyze.dag b/src/v2/lens/complexity_accumulator_copy/analyze.dag index 13b6e6b697b..13198a9a948 100644 --- a/src/v2/lens/complexity_accumulator_copy/analyze.dag +++ b/src/v2/lens/complexity_accumulator_copy/analyze.dag @@ -1,5 +1,51 @@ module v2.lens.complexity_accumulator_copy.analyze +import v2.lens.complexity_accumulator_copy { + BindsComputed, + BindsFresh, + Finding, + LetBinding, + LetBindingFact, + PortBareName, + PortComputedExpression, + PortMissing, + PortPureLiteral, + PortReading, + Poly2Suspect, + Unclassifiable, + any_port_carries_carrier, + classify_call, + let_binding_fact_for, + resolve_port_reading, + symbol_in +} +import v2.extdeps.languages.dag { + ParseSubtreeAbsent, + ParseSubtreeFound, + dag_lex_token_symbol, + parse_production_captured_child_optional, + parse_production_emitted_identity_optional, + parse_subtree_find_production_captured +} +import std.algebra { Cons, Empty } +import v2.compiler.fold_lowering { fold_call_to_loop, fold_family_head } +import v2.std.algebra { list_append, list_map, list_reverse } +import v2.std.collection { Absent, List, Optional, Present } +import v2.std.diagnostic { Accepted, Rejected } +import v2.std.grammar { node_atom_identity_optional } +import v2.std.integer { Int } +import v2.std.logic { Bool } +import v2.std.node { + Ambiguous, + Edge, + Found, + Named, + Node, + Positional, + Symbol, + loop_carrier_binder_target +} +import v2.std.node_query { find_named_child } fn named_child_optional(cap: Node, name: Symbol) -> Optional { match v2.std.node_query.find_named_child(root: cap, name: name) { diff --git a/src/v2/lens/coverage.dag b/src/v2/lens/coverage.dag index 65c683ce420..94566269f31 100644 --- a/src/v2/lens/coverage.dag +++ b/src/v2/lens/coverage.dag @@ -1,5 +1,21 @@ module v2.lens.coverage - +import v2.lens.common.construction_justification { + ConstructionJustification, + WallAfterGrounding, +} +import std.disposition { SubstrateMandatoryTag } +import std.algebra { + Cons, + Empty, +} +import v2.std.algebra { + contains, + filter, + fold_list_right, + list_snoc_item, +} +import v2.std.collection { List } +import v2.std.logic { Bool } type Coverage { concern: C diff --git a/src/v2/lens/disposition_redundancy.dag b/src/v2/lens/disposition_redundancy.dag index f562eeea48c..5105984c2bc 100644 --- a/src/v2/lens/disposition_redundancy.dag +++ b/src/v2/lens/disposition_redundancy.dag @@ -1,6 +1,26 @@ module v2.lens.disposition_redundancy - - +import v2.lens.common.construction_justification { + ConstructionJustification, + WallAfterGrounding, +} +import std.disposition { + Disposition, + Scaffold, + Terminal, + SubstrateMandatoryTag, +} +import std.decl_ref { + DeclarationRef, + DeclField, + WholeDeclaration, + NamedField, +} +import v2.std.collection { List } +import v2.std.algebra { + count_where, + any, +} +import v2.std.logic { Bool } fn decl_field_eq(a: DeclField, b: DeclField) -> Bool { match a { diff --git a/src/v2/lens/edit_locus.dag b/src/v2/lens/edit_locus.dag index 03197894716..edd96aebd95 100644 --- a/src/v2/lens/edit_locus.dag +++ b/src/v2/lens/edit_locus.dag @@ -1,5 +1,25 @@ module v2.lens.edit_locus +import v2.lens.common.construction_justification { ConstructionJustification, WallAfterGrounding } +import std.disposition { SingleAuthority } +import v2.compiler.infer { InferredTree } +import v2.lens.affected_set { AffectedSetReading, affected_set_reading } +import std.algebra { Cons, Empty, FreeMonoid } +import v2.std.algebra { count_equal, fold_list, length, list_append } +import v2.std.artifact { NodeArtifactProvenance } +import v2.std.collection { List } +import v2.std.diagnostic { + Diagnostic, + ExternalContractUnknown, + Unavailable, + node_locus +} +import v2.std.exact_structural_equality_zip_fold_predicate { + exact_structural_equality_zip_fold +} +import v2.std.node { Conj, Node, Symbol, TypeNode, SyntheticOccurrence } +import v2.std.text { String } +import v2.std.witness { Holds, Violates, Witness } type RepoPath = String diff --git a/src/v2/lens/enforcement/grammar_coverage.dag b/src/v2/lens/enforcement/grammar_coverage.dag index a1267f5962c..70b6d56233e 100644 --- a/src/v2/lens/enforcement/grammar_coverage.dag +++ b/src/v2/lens/enforcement/grammar_coverage.dag @@ -1,4 +1,34 @@ module v2.lens.enforcement.grammar_coverage +import v2.compiler.normalize { normalize } +import v2.compiler.parse { parse_module } +import v2.compiler.tokenize { tokenize } +import v2.extdeps.languages.dag { dag_language_model } +import v2.lens.coverage { dedupe_snoc } +import v2.lens.enforcement.standing_intent { whole_corpus_scope } +import std.algebra { Empty } +import v2.std.algebra { + filter, + fold_list, + length, + list_append, +} +import v2.std.collection { List } +import v2.std.decl_index { + DeclFact, + decl_facts, +} +import v2.std.diagnostic { + Accepted, + Rejected, +} +import v2.std.logic { Bool } +import v2.std.node { + Symbol, + symbol_identity_digest, +} +import v2.std.text { String } + +import extdeps.filesystem.filesystem_io type GrammarCoverageParseVerdict diff --git a/src/v2/lens/enforcement/standing_intent.dag b/src/v2/lens/enforcement/standing_intent.dag index 913736883b4..bb95096a040 100644 --- a/src/v2/lens/enforcement/standing_intent.dag +++ b/src/v2/lens/enforcement/standing_intent.dag @@ -1,5 +1,32 @@ module v2.lens.enforcement.standing_intent - +import v2.std.logic { Bool } +import v2.std.collection { List } +import v2.std.text { String } +import v2.std.qualified_name { qualified_name_from_dotted_string } +import v2.lens.registry { + LensIdV0, + Cost, +} +import v2.lens.enforcement.vocab { + SubjectRoster, + ScopeRoster, + EnforcementMode, + Advisory, + AuditOnly, + Blocking, + ConsumerRequirement, + AnyLiveConsumer, + OneOf, + Exact, + ConsumerKind, + FloorGate, + MergeAdmission, + PrePushHook, + RoadmapDriftGate, + NarrowingReason, + BootstrapBlocked, + TypeReflectionUnavailable, +} type IntentProperty = LensFamily { lens: v2.lens.registry.LensIdV0 } diff --git a/src/v2/lens/enforcement/vocab.dag b/src/v2/lens/enforcement/vocab.dag index d89a02ec0ec..3bb83f707a3 100644 --- a/src/v2/lens/enforcement/vocab.dag +++ b/src/v2/lens/enforcement/vocab.dag @@ -1,5 +1,23 @@ module v2.lens.enforcement.vocab - +import v2.std.logic { Bool } +import v2.std.integer { Int } +import v2.std.text { String } +import v2.std.collection { List } +import v2.std.algebra { + for_all, + contains, +} +import v2.std.qualified_name { QualifiedName } +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import std.realization_schedule { ScheduleWitnessEntry } type SubjectRoster { entries: List diff --git a/src/v2/lens/fact_density.dag b/src/v2/lens/fact_density.dag index 70aa4994e46..165d573f66e 100644 --- a/src/v2/lens/fact_density.dag +++ b/src/v2/lens/fact_density.dag @@ -1,5 +1,36 @@ module v2.lens.fact_density +import v2.lens.common.construction_justification { ConstructionJustification, WallAfterGrounding } +import std.disposition { SubstrateMandatoryTag } +import v2.std.diagnostic { + Diagnostic, + ExternalContractUnknown, + Outcome, + Unavailable, + outcome_accepted, + outcome_rejected, + port_locus +} +import v2.std.node { + Node, + Edge, + Named, + Positional, + Connective, + Atom, + Conj, + Disj, + Arrow, + Cardinality, + Instantiation, + TypeNode, + ComputationNode, + Symbol +} +import v2.std.nat { Nat, Zero, Succ } +import v2.std.cardinality { NonZeroNat } +import v2.std.witness { Holds, Witness } + fn symbol_is_kernel_ambient(s: Symbol) -> Bool { s == ^fact_density_kernel_ambient_string || s == ^fact_density_kernel_ambient_int || diff --git a/src/v2/lens/inert_lens.dag b/src/v2/lens/inert_lens.dag index c5da0792e85..b7d1d10298e 100644 --- a/src/v2/lens/inert_lens.dag +++ b/src/v2/lens/inert_lens.dag @@ -1,5 +1,10 @@ module v2.lens.inert_lens - +import v2.lens.common.construction_justification { + ConstructionJustification, + WallAfterGrounding, +} +import std.disposition { RealizationDispatch } +import v2.std.logic { Bool } fn inert_lens_unreached_clean_for_count(unreached_count: Int) -> Bool { unreached_count == 0 diff --git a/src/v2/lens/registry.dag b/src/v2/lens/registry.dag index f510433af86..5a815be51dd 100644 --- a/src/v2/lens/registry.dag +++ b/src/v2/lens/registry.dag @@ -1,5 +1,16 @@ module v2.lens.registry - +import v2.lens.common.construction_justification { + ConstructionJustification, + WallAfterGrounding, +} +import std.disposition { SingleAuthority } +import v2.std.algebra { + count_where, + for_all, +} +import v2.std.collection { List } +import v2.std.node { Symbol } +import v2.std.text { String } type LensIdV0 = Complexity diff --git a/src/v2/lens/unit_modeling.dag b/src/v2/lens/unit_modeling.dag index 60dc0713e4c..fed5e54524b 100644 --- a/src/v2/lens/unit_modeling.dag +++ b/src/v2/lens/unit_modeling.dag @@ -1,5 +1,40 @@ module v2.lens.unit_modeling +import v2.lens.common.construction_justification { ConstructionJustification, RatchetForever } +import v2.std.node { + Node, + Edge, + Named, + Positional, + TypeNode, + ComputationNode, + Symbol +} +import v2.std.node_query { edge_field_type_name } +import v2.std.collection { + List, + Map, + Optional, + Present, + Absent, + optional_present, + optional_absent, + optional_prefer_first_present, + empty_map, + map_insert, + map_get +} +import v2.std.diagnostic { + Diagnostic, + ExternalContractUnknown, + Outcome, + Accepted, + Unavailable, + outcome_accepted, + outcome_rejected, + node_locus +} +import v2.std.witness { Holds, Witness } type UnitFieldRow { field: Symbol diff --git a/src/v2/std/algebra.dag b/src/v2/std/algebra.dag index d4e79c2668b..88cba7a5056 100644 --- a/src/v2/std/algebra.dag +++ b/src/v2/std/algebra.dag @@ -25,6 +25,7 @@ import std.algebra { Semigroup, Semiring, } +import std.types { is_prefix_of } type ApproximateField { add: fn(T, T) -> T @@ -760,22 +761,6 @@ fn reduce_or(xs: FreeMonoid, fallback: T, combine: fn(T, T) -> T) -> T { } } -fn is_prefix_of( - prefix: FreeMonoid, - xs: FreeMonoid, - eq: fn(T, T) -> Bool -) -> Bool { - match prefix { - Empty => true - Cons { head: h_prefix, tail: t_prefix } => - match xs { - Empty => false - Cons { head: h_xs, tail: t_xs } => - eq(h_prefix, h_xs) && is_prefix_of(prefix: t_prefix, xs: t_xs, eq: eq) - } - } -} - type Homomorphism { source: C target: C diff --git a/src/v2/std/artifact.dag b/src/v2/std/artifact.dag index 1815c892f67..928d069da33 100644 --- a/src/v2/std/artifact.dag +++ b/src/v2/std/artifact.dag @@ -1,4 +1,9 @@ module v2.std.artifact + +import v2.std.node { Symbol } +import std.types { String, Bool } +import v2.std.diagnostic { Locus, Outcome, Accepted, Rejected } + type ArtifactKind = SourceFile | GeneratedSource diff --git a/src/v2/std/cross_tree/resolution.dag b/src/v2/std/cross_tree/resolution.dag index c6e23efb4be..67bd4ac43ac 100644 --- a/src/v2/std/cross_tree/resolution.dag +++ b/src/v2/std/cross_tree/resolution.dag @@ -1,4 +1,9 @@ module v2.std.cross_tree.resolution + +import v2.std.qualified_name { QualifiedName } +import v2.std.cross_tree.import_model { SourceRootRef } +import std.algebra { FreeMonoid } + type SourceRootBinding { module: QualifiedName root: SourceRootRef diff --git a/src/v2/std/decl_index.dag b/src/v2/std/decl_index.dag index 23884a60799..99e58396ef2 100644 --- a/src/v2/std/decl_index.dag +++ b/src/v2/std/decl_index.dag @@ -1,4 +1,27 @@ module v2.std.decl_index +import std.algebra { Empty } +import std.disposition { + Disposition, + Scaffold, + SingleAuthority, +} +import std.decl_ref { + DeclarationRef, + WholeDeclaration, +} +import v2.std.algebra { + length, + list_snoc_item, +} +import v2.std.collection { List } +import v2.std.logic { Bool } +import v2.std.node { Node } +import v2.std.node_query { + node_labeled_child_edges, + node_positional_child_targets, +} +import v2.std.text { String } + type ItemKind = FnItem | FuncItem diff --git a/src/v2/std/determinism.dag b/src/v2/std/determinism.dag index 5fcbbed6fb8..7811b61cb69 100644 --- a/src/v2/std/determinism.dag +++ b/src/v2/std/determinism.dag @@ -1,4 +1,8 @@ module v2.std.determinism + +import std.determinism { Determinism } +import v2.std.node { Symbol } + type DeterminismFact { signature: Symbol, classification: std.determinism.Determinism diff --git a/src/v2/std/grounding.dag b/src/v2/std/grounding.dag index ed794250ed2..8dd1f7ef4bd 100644 --- a/src/v2/std/grounding.dag +++ b/src/v2/std/grounding.dag @@ -1,4 +1,34 @@ module v2.std.grounding + +import v2.std.collection { Absent, Map, Present, empty_map, map_get, map_insert } +import v2.std.diagnostic { + Accepted, + Diagnostic, + Outcome, + Rejected, + Unavailable, + UserInputBoundary, + node_locus, + outcome_accepted, + outcome_rejected, + port_locus +} +import v2.std.host_run { EmitHostRunReceipt } +import v2.std.logic { Bool } +import v2.std.model_core { + ModelCoreFactAxisEncoding, + ModelCoreFactAxisOverflowDisposition, + ModelCoreFactAxisRange, + ModelCoreFactAxisSignedness, + ModelCoreFactAxisSurfaceSpelling, + ModelCoreFactAxisWidth, + ModelCorePrimitiveFactAxis, + PrimitiveFactBundle +} +import v2.std.node { Node, Symbol } +import v2.std.compilers.target_model { FunctionBoundarySite, TargetModel } +import v2.std.verdict { VerdictTally } + type PerLanguageFactBundleKey { subject_carrier: Node target: TargetModel diff --git a/src/v2/test/claim/manual/find_witness_project_to_core_controls.dag b/src/v2/test/claim/manual/find_witness_project_to_core_controls.dag index 225cec32325..44bb252356a 100644 --- a/src/v2/test/claim/manual/find_witness_project_to_core_controls.dag +++ b/src/v2/test/claim/manual/find_witness_project_to_core_controls.dag @@ -1,8 +1,73 @@ module v2.test.manual.find_witness_project_to_core_controls - - -data live_tree_disposition: v2.std.live_tree.LiveTreeDisposition = SubstrateInputsOnly +import std.algebra { Equal, Greater, Less } +import v2.std.collection { List } +import v2.std.diagnostic { + Accepted, + Rejected +} +import v2.std.find_witness { + CandidateSet, + PreservationPredicate, + UniqueOnly, + find_witness, + find_witness_derives +} +import v2.std.integer { + IntegerRangeInclusiveMin, + Signed, + Unsigned, + int16_interval_spec, + int32_interval_spec, + int8_interval_spec, + int_platform_interval_spec, + integer_concrete_zero, + integer_interval_bound_compare, + integer_interval_spec_contains, + integer_interval_spec_node, + integer_pointer_width_bound, + uint8_interval_spec, + uint_platform_interval_spec +} +import v2.std.integer_value_set { + integer_interval_value_set_node, + integer_unbounded_value_set_node, + integer_value_set_contains, + integer_value_set_strictly_contains +} +import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } +import v2.std.model_core { + ModelCoreFactAxisEncoding, + ModelCoreFactAxisSurfaceSpelling +} +import v2.std.node { + Atom, + Conj, + Disj, + Edge, + Node, + Symbol, + SyntheticOccurrence, + TypeNode +} +import v2.std.refinement_widening_predicate { + refinement_widening_predicate_algebra_for_value_sets, + refinement_widening_preservation_holds +} +import v2.std.verification { + BoolWitness, + BoolWitnessClaim, + UnifiedTestClaim +} +import v2.test.fixture.derivable_coercion_task_id { + account_id_wrong_inhabitant_node, + derivable_coercion_candidate_closedness, + task_id_api_inhabitant_node, + task_id_db_inhabitant_node, + task_id_wire_inhabitant_node +} + +data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly fn control_candidate_set(candidates: List, closedness_evidence: Node) -> CandidateSet { CandidateSet { diff --git a/src/v2/test/claim/manual/rust_wire_serde_naming_policy_test.dag b/src/v2/test/claim/manual/rust_wire_serde_naming_policy_test.dag index 37570fa5d86..96c5d1ad2b7 100644 --- a/src/v2/test/claim/manual/rust_wire_serde_naming_policy_test.dag +++ b/src/v2/test/claim/manual/rust_wire_serde_naming_policy_test.dag @@ -1,17 +1,37 @@ module v2.test.manual.rust_wire_serde_naming_policy_test +import v2.compiler.translate { target_serialize_source_from_model } +import v2.extdeps.languages.rust_wire_serde { + rust_wire_serde_review_event_emitted, + rust_wire_serde_screaming_snake_target, + rust_wire_serde_snake_case_target, + rust_ws_review_event_body_golden, + rust_ws_review_event_screaming_golden, + rust_ws_review_event_snake_golden +} +import v2.std.compilers.target_model { TargetModel } +import v2.std.diagnostic { Accepted, Rejected } +import v2.std.logic { Bool } +import v2.std.node { Node } +import v2.std.text { String } +import v2.std.verification { + BoolWitness, + BoolWitnessClaim, + UnifiedTestClaim +} +import v2.std.live_tree { LiveTreeDisposition, SubstrateInputsOnly } -data live_tree_disposition: v2.std.live_tree.LiveTreeDisposition = SubstrateInputsOnly +data live_tree_disposition: LiveTreeDisposition = SubstrateInputsOnly -fn rust_ws_serialize_accepts(target: v2.std.compilers.target_model.TargetModel, emitted: Node) -> Bool { - match v2.compiler.translate.target_serialize_source_from_model(target: target, emitted: emitted) { +fn rust_ws_serialize_accepts(target: TargetModel, emitted: Node) -> Bool { + match target_serialize_source_from_model(target: target, emitted: emitted) { Accepted { value: _, diagnostics: _ } => true Rejected { diagnostics: _ } => false } } -fn rust_ws_serialized_text(target: v2.std.compilers.target_model.TargetModel, emitted: Node) -> String { - match v2.compiler.translate.target_serialize_source_from_model(target: target, emitted: emitted) { +fn rust_ws_serialized_text(target: TargetModel, emitted: Node) -> String { + match target_serialize_source_from_model(target: target, emitted: emitted) { Accepted { value: source, diagnostics: _ } => source.carried Rejected { diagnostics: _ } => "" } @@ -19,41 +39,41 @@ fn rust_ws_serialized_text(target: v2.std.compilers.target_model.TargetModel, em test fn witness_rust_wire_serde_screaming_snake_holds() -> Bool { rust_ws_serialize_accepts( - target: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_screaming_snake_target, - emitted: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_review_event_emitted + target: rust_wire_serde_screaming_snake_target, + emitted: rust_wire_serde_review_event_emitted ) && rust_ws_serialized_text( - target: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_screaming_snake_target, - emitted: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_review_event_emitted + target: rust_wire_serde_screaming_snake_target, + emitted: rust_wire_serde_review_event_emitted ) == rust_ws_review_event_screaming_golden } test fn witness_rust_wire_serde_snake_case_holds() -> Bool { rust_ws_serialize_accepts( - target: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_snake_case_target, - emitted: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_review_event_emitted + target: rust_wire_serde_snake_case_target, + emitted: rust_wire_serde_review_event_emitted ) && rust_ws_serialized_text( - target: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_snake_case_target, - emitted: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_review_event_emitted + target: rust_wire_serde_snake_case_target, + emitted: rust_wire_serde_review_event_emitted ) == rust_ws_review_event_snake_golden } test fn witness_rust_wire_serde_naming_discriminates() -> Bool { let screaming = rust_ws_serialized_text( - target: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_screaming_snake_target, - emitted: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_review_event_emitted + target: rust_wire_serde_screaming_snake_target, + emitted: rust_wire_serde_review_event_emitted ) let snake = rust_ws_serialized_text( - target: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_snake_case_target, - emitted: v2.extdeps.languages.rust_wire_serde.rust_wire_serde_review_event_emitted + target: rust_wire_serde_snake_case_target, + emitted: rust_wire_serde_review_event_emitted ) screaming != snake - && screaming != v2.extdeps.languages.rust_wire_serde.rust_ws_review_event_body_golden - && snake != v2.extdeps.languages.rust_wire_serde.rust_ws_review_event_body_golden + && screaming != rust_ws_review_event_body_golden + && snake != rust_ws_review_event_body_golden } -data unified_claim_rust_wire_serde_screaming_snake: v2.std.verification.UnifiedTestClaim = BoolWitnessClaim { +data unified_claim_rust_wire_serde_screaming_snake: UnifiedTestClaim = BoolWitnessClaim { witness: BoolWitness { entry: "src/v2/test/claim/manual/rust_wire_serde_naming_policy_test.dag", function: witness_rust_wire_serde_screaming_snake_holds diff --git a/src/v2/test/fixture/derivable_coercion_task_id.dag b/src/v2/test/fixture/derivable_coercion_task_id.dag index 05b5029dc84..11103fe9789 100644 --- a/src/v2/test/fixture/derivable_coercion_task_id.dag +++ b/src/v2/test/fixture/derivable_coercion_task_id.dag @@ -1,5 +1,19 @@ module v2.test.fixture.derivable_coercion_task_id +import v2.std.model_core { + ModelCoreFactAxisEncoding, + ModelCoreFactAxisSurfaceSpelling +} +import v2.std.node { + Atom, + Conj, + Edge, + Node, + Symbol, + SyntheticOccurrence, + TypeNode +} +import v2.std.witness { StructuralPropertyWitness } fn task_id_inhabitant_atom(id: Symbol) -> Node { Node { diff --git a/src/v2/workflow/floor_discovery_producer.dag b/src/v2/workflow/floor_discovery_producer.dag index 6701bf8111a..9632251c9da 100644 --- a/src/v2/workflow/floor_discovery_producer.dag +++ b/src/v2/workflow/floor_discovery_producer.dag @@ -17,7 +17,8 @@ import v2.workflow.floor_naming_hygiene { floor_test_marked_decl_allowed_in_entry, floor_wire_contract_decl_allowed_in_entry, floor_test_sidecar_suffix, - floor_wire_contract_sidecar_suffix + floor_wire_contract_sidecar_suffix, + floor_discovery_scan_test_decl_names } import v2.std.live_tree { LiveTreeDisposition, ReadsLiveTree, SubstrateInputsOnly } import v2.std.optional { @@ -108,88 +109,6 @@ fn floor_discovery_path_excluded(path: String, exclude_substrings: List) ) } -fn floor_discovery_line_starts_test_decl(line: String) -> Bool { - starts_with(s: trim(line), prefix: "test fn ") || starts_with(s: trim(line), prefix: "test data ") -} - -fn floor_discovery_test_rest_from_line(line: String) -> String { - let trimmed = trim(line) - if starts_with(s: trimmed, prefix: "test fn ") { - substring(s: trimmed, start: 8, end: string_length(s: trimmed)) - } else if starts_with(s: trimmed, prefix: "test data ") { - substring(s: trimmed, start: 10, end: string_length(s: trimmed)) - } else { - "" - } -} - -fn floor_discovery_first_token_before_space(seg: String) -> String { - fold( - split(s: seg, delimiter: " "), - init: "", - f: fn(name, token) { - if name != "" { - name - } else if token == "" { - "" - } else { - token - } - } - ) -} - -fn floor_discovery_test_decl_name_from_rest(rest: String) -> String { - let before_paren = fold( - split(s: rest, delimiter: "("), - init: "", - f: fn(acc, seg) { - if acc != "" { - acc - } else { - seg - } - } - ) - let before_colon = fold( - split(s: before_paren, delimiter: ":"), - init: "", - f: fn(acc, seg) { - if acc != "" { - acc - } else { - seg - } - } - ) - floor_discovery_first_token_before_space(seg: before_colon) -} - -fn floor_discovery_test_decl_name_from_line(line: String) -> String { - floor_discovery_test_decl_name_from_rest( - rest: floor_discovery_test_rest_from_line(line: line) - ) -} - -fn floor_discovery_scan_test_decl_names(content: String) -> List { - fold( - split(s: content, delimiter: "\n"), - init: [], - f: fn(acc, line) { - if floor_discovery_line_starts_test_decl(line: line) { - let name = floor_discovery_test_decl_name_from_line(line: line) - if name == "" { - acc - } else { - concat(acc, [name]) - } - } else { - acc - } - } - ) -} - fn floor_discovery_line_has_wire_contract_decl(line: String) -> Bool { let trimmed = trim(line) if starts_with(s: trimmed, prefix: "data ") { @@ -776,30 +695,6 @@ fn floor_discovery_wire_contract_sidecar_refusal_for_content( } } -fn floor_filename_hygiene_refusal_for_paths( - dag_paths: List -) -> Optional { - fold_list( - xs: dag_paths, - empty: optional_absent(), - cons: fn(found, path) { - match found { - Present { value: _ } => found - Absent => if floor_filename_contains_double_underscore(path: path) { - optional_present( - value: concat( - "filename hygiene: `.dag` basenames must not contain `__`; offending: ", - path - ) - ) - } else { - optional_absent() - } - } - } - ) -} - data floor_discovery_producer_note: String = "Floor discovery producer: enrolled witness roster = pure fold over Filesystem.List/Read host facts, owned-data transport records (host-materialized from scan_dirs by invoke_floor_discovery_producer before the producer call — scan_dirs is not a producer parameter), witness_exclusion_substrings, and *_test.dag naming rules. List/read failures increment walk_failures with a located Optional path; finalize refuses, never an empty roster. Interior directory candidates (basename has no '.') are descended; dotted basenames are skipped as non-dag files." data floor_discovery_directory_candidate_dissolve_on: String = "dissolve-on: floor_discovery_directory_candidate — basename-without-dot descent heuristic dissolves when Filesystem.List surfaces entry kind (file | directory) and the walker consumes it; live dag/ + src/v2/ corpora have zero dotted directory basenames today (find -type d -name '*.*' empty)." @@ -809,10 +704,10 @@ data floor_discovery_live_tree_disposition_dissolve_on: String = "dissolve-on: f data floor_discovery_surface_text_scan_scaffold: Disposition = Scaffold { dissolves_to: SingleAuthority, bind: DeclarationRef { - module_path: "v2.workflow.floor_discovery_producer", + module_path: "v2.workflow.floor_naming_hygiene", decl_name: "floor_discovery_scan_test_decl_names", field: WholeDeclaration } } -data floor_discovery_surface_text_scan_dissolve_on: String = "🟡 dissolve-on: floor_discovery_surface_text_scan — producer recovers test-decl names, live_tree_disposition rows, and CoproductWireContract markers via hand-rolled line/token splitting over raw source text (§4 grammar-owned-reads violation); DISSOLVES WHEN discovery enumeration consumes grammar-owned parse/AST facts from the same ingress surface as v2.compiler so structural reads are not forked from the ingester." +data floor_discovery_surface_text_scan_dissolve_on: String = "🟡 dissolve-on: floor_discovery_surface_text_scan — naming hygiene recovers test-decl names (and the producer recovers live_tree_disposition rows + CoproductWireContract markers) via hand-rolled line/token splitting over raw source text (§4 grammar-owned-reads violation); DISSOLVES WHEN discovery enumeration consumes grammar-owned parse/AST facts from the same ingress surface as v2.compiler so structural reads are not forked from the ingester. Authority moved to floor_naming_hygiene so orphan/filename resolve stays free of the Filesystem service closure." diff --git a/src/v2/workflow/floor_naming_hygiene.dag b/src/v2/workflow/floor_naming_hygiene.dag index e84cdc16750..881fcca4990 100644 --- a/src/v2/workflow/floor_naming_hygiene.dag +++ b/src/v2/workflow/floor_naming_hygiene.dag @@ -1,6 +1,14 @@ module v2.workflow.floor_naming_hygiene -import std.types { String, Bool } +import std.types { String, Bool, List } +import v2.std.optional { + Absent, + Optional, + Present, + optional_absent, + optional_present +} +import v2.std.algebra { fold_list } data floor_test_sidecar_suffix: String = "_test.dag" data floor_wire_contract_sidecar_suffix: String = "_contracts.dag" @@ -50,4 +58,110 @@ fn floor_wire_contract_decl_allowed_in_entry(entry_path: String) -> Bool { floor_entry_requires_wire_contract_sidecar(entry_path: entry_path) } -data floor_naming_hygiene_note: String = "Single authority for floor witness filename + sidecar placement predicates. Host discovery walks files and projects rows; these pure fns decide whether a path or entry placement is admissible. Dissolves HAND-Rust mirrors in cli_run.rs check_floor_filename_hygiene and SIDECAR_PLACEMENT_RULES suffix checks once dual-run equivalence receipts are green." +fn floor_discovery_line_starts_test_decl(line: String) -> Bool { + starts_with(s: trim(line), prefix: "test fn ") || starts_with(s: trim(line), prefix: "test data ") +} + +fn floor_discovery_test_rest_from_line(line: String) -> String { + let trimmed = trim(line) + if starts_with(s: trimmed, prefix: "test fn ") { + substring(s: trimmed, start: 8, end: string_length(s: trimmed)) + } else if starts_with(s: trimmed, prefix: "test data ") { + substring(s: trimmed, start: 10, end: string_length(s: trimmed)) + } else { + "" + } +} + +fn floor_discovery_first_token_before_space(seg: String) -> String { + fold( + split(s: seg, delimiter: " "), + init: "", + f: fn(name, token) { + if name != "" { + name + } else if token == "" { + "" + } else { + token + } + } + ) +} + +fn floor_discovery_test_decl_name_from_rest(rest: String) -> String { + let before_paren = fold( + split(s: rest, delimiter: "("), + init: "", + f: fn(acc, seg) { + if acc != "" { + acc + } else { + seg + } + } + ) + let before_colon = fold( + split(s: before_paren, delimiter: ":"), + init: "", + f: fn(acc, seg) { + if acc != "" { + acc + } else { + seg + } + } + ) + floor_discovery_first_token_before_space(seg: before_colon) +} + +fn floor_discovery_test_decl_name_from_line(line: String) -> String { + floor_discovery_test_decl_name_from_rest( + rest: floor_discovery_test_rest_from_line(line: line) + ) +} + +fn floor_discovery_scan_test_decl_names(content: String) -> List { + fold( + split(s: content, delimiter: "\n"), + init: [], + f: fn(acc, line) { + if floor_discovery_line_starts_test_decl(line: line) { + let name = floor_discovery_test_decl_name_from_line(line: line) + if name == "" { + acc + } else { + concat(acc, [name]) + } + } else { + acc + } + } + ) +} + +fn floor_filename_hygiene_refusal_for_paths( + dag_paths: List +) -> Optional { + fold_list( + xs: dag_paths, + empty: optional_absent(), + cons: fn(found, path) { + match found { + Present { value: _ } => found + Absent => if floor_filename_contains_double_underscore(path: path) { + optional_present( + value: concat( + "filename hygiene: `.dag` basenames must not contain `__`; offending: ", + path + ) + ) + } else { + optional_absent() + } + } + } + ) +} + +data floor_naming_hygiene_note: String = "Single authority for floor witness filename + sidecar placement + test-decl name scan predicates. Host discovery walks files and projects rows; these pure fns decide whether a path or entry placement is admissible and which decls a *_test.dag enrolls. Lives here (not in floor_discovery_producer) so orphan/filename hygiene resolve stays free of the Filesystem service closure — filesystem_io's stripped ExternalAuthority/Uri imports are Class-B accidental coverage and refuse when resolved as a small entry. Dissolves HAND-Rust mirrors in cli_run.rs check_floor_filename_hygiene and SIDECAR_PLACEMENT_RULES suffix checks once dual-run equivalence receipts are green."