Repository navigation
Emission follows resolution: one authority for the kernel-identity fact, and the witness enrolled - #9862
Conversation
…key use-line derivation on the resolved kernel identity Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GXfYKNQTD3VfYyQcnJpxNU
…ion_equal=true) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GXfYKNQTD3VfYyQcnJpxNU
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 471e8d8de3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| source_indices: source_indices, | ||
| module_index: module_index) | ||
| module_index: module_index, | ||
| module_env: module_env) |
There was a problem hiding this comment.
Filter kernel-resolved names from wildcard imports
When a module uses an all-import such as import v2.std.text, passing module_env into emit_specific_import_block does not prevent the shadow this change targets: the wildcard arm still unconditionally emits use crate::v2_std_text::*;, which brings the structural String declaration into scope regardless of the filtered specific block. Such consumers therefore continue to bind emitted bare String references to the structural alias instead of the host/kernel type and can retain the same E0308 failures; the wildcard line itself must honor the resolution filter rather than only filtering the supplementary explicit imports.
Useful? React with 👍 / 👎.
|
DO NOT MERGE IN THIS STATE — converting to draft to prevent an accident. This PR is CLEAN, green, and carries an approval bound to its exact head — and merging it would revert most of tonight's work. Measured against
So essentially all of that 11,502-line deletion is main's newer content being removed. Seven PRs have landed tonight (#9720, #9850, #9858, #9773, #9866, #9851, #9865) and this branch predates them.
@bold-carp-449 — before pushing your follow-up: merge Note the approval on this head does not survive that push, which is correct — it was a statement about a tree nobody should ship. |
…llows-resolution witness The infer-side rewire guard and the emit-side use-line decision were each re-deriving "is this resolved node the kernel identity for this name" from the ident_span file marker. That is one semantic fact with two readers, which is the shape of the defect they exist to repair. Hoist it to v1.compiler.infer_env resolved_node_is_kernel_identity_for_name and have both consume it; the emitter's additional structureless-scalar condition composes beside it rather than folding into it. Enrol emit_import_lines_follow_resolved_binding_identity as the discriminating RED with two positive controls (a non-kernel import keeps its use-line; a kernel-SPELLED name whose kernel binding is structural keeps its use-line). Declare the rung drop recording that it executes in rust-unit-tests, outside the required aggregate, with the restoration trigger named at capability grain. Note: compiler_tests.rs is regenerated after the origin/main merge in the following commit; the authority here is the .dag. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BDnHQs9oE5AKJXe1vReU8v
|
Correction to my previous comment — I was wrong about the revert. I claimed merging this would delete main's newer content, based on The check I should have run first: The merge result is byte-identical to main. This PR merges to a no-op — it was never a revert risk. What stands: the branch contributes nothing beyond main, so closing it is still correct housekeeping and the content measurements in my earlier comment (added lines already present in main) were accurate. Only the "would revert" conclusion was false, and the alarm it raised was unjustified. Reusable form, since this will bite someone else: a raw Additionally: I converted this PR to draft on that false basis. It is safe to merge (as a no-op) or to build on. Leaving it as draft only because @bold-carp-449 is folding follow-up work in, which will supersede this head regardless — say the word and I will flip it back to ready. |
Resolves six unmerged paths from the squash-merge of #9850. Two were genuine .dag authority conflicts, resolved toward this branch's newer content. One mattered beyond recency: main's side of 05_emit_rust.dag still carried string_contains(sp.file, "<kernel:"), the substring test that this branch replaces with exact equality against the resolved kernel identity. Taking either side wholesale would have silently reinstated the weaker second authority. Four were generated paths where the merge driver refused: no conflict markers, ours-side bytes in the worktree, main's newer generated content dropped. A marker grep reads that tree as clean; git ls-files -u does not. The build then failed on LiteralUnfolding::UnicodeScalarSequenceUnfold not covered -- main's own #9720 content missing from exactly those four files -- so the mirror was internally inconsistent in a way only a compile revealed. Bootstrapped to main's consistent mirror to obtain a buildable seed; the bytes here are regenerated from the merged authority, which is the resolution that is neither side. #9865 added a required `standing` field to RungDrop after this branch authored its row. The text merge combined both sides with no conflict and the typecheck refused with an exact location, which is the fail-closed property working as intended. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BDnHQs9oE5AKJXe1vReU8v
…erified) Round 2 after installing the round-1 candidate and rebuilding from the installed seed: first_generation_equal=true, and --required-regen-fixed-point reports fixed_point_equal=true referenced_first_generation_equal=true at 20e5f08. The rebuild matters: the first pass runs a binary that predates the change it emits, so a single pass can self-verify at divergence 0 for the wrong reason. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BDnHQs9oE5AKJXe1vReU8v
#9867 and this branch each added a witness to compiler_tests_rust.dag. The .dag authority merged cleanly and carries both; only the two generated projections conflicted, and the driver refused them with no conflict markers and ours-side bytes in the worktree. Regenerated from the merged authority rather than picking a side. The candidate carries both ct_import_lines_follow_resolved_binding_identity_test and ct_shell_service_output_projection_known_hole_probe_test -- taking either side would have dropped the other silently. Two rounds were needed because v1_compiler_compiler_tests_rust.rs is the emitter and compiler_tests.rs is what it emits, so each install reveals the next layer on rebuild. first_generation_equal=true at round 3. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BDnHQs9oE5AKJXe1vReU8v
Follow-up to #9850. This is a single-authority consolidation, not a repair — see the measurement below before citing it as coverage.
What it does
The infer-side rewire guard and the emit-side use-line filter were each re-deriving "is this resolved node the kernel identity for this name" from the
ident_spanfile marker — and deriving it differently: exact equality on one side,string_contains(sp.file, "<kernel:")on the other. One semantic fact, two readers, one of them weaker. That is the shape of the defect they exist to repair.Hoisted to
v1.compiler.infer_env resolved_node_is_kernel_identity_for_name; both consume it. The emitter's additional condition — that the kernel node is a host-realized structureless scalar, which excludes structural kernels likeBool = True | Falsewhose use-line is the path to the realization — composes beside it rather than folding into it.import_name_resolves_to_kernelis renamed toimport_name_resolves_to_host_realized_kernel_scalar, because the old name described only half of what the predicate now asks. Same function (emit_specific_import_block), same call site. Lanes grepping the old symbol after this lands will get a true-but-misleading absence.The tightening does NOT discriminate — measured, not assumed
Exact equality and the substring test differ only when a name
Xresolves to a binding spanned"<kernel:Y>"withY ≠ X. I tested whether that state is reachable:type Char = Int(alias onto a kernel name), importedpub use crate::probe_aliaskernel::{Char, Carrier};— kepttype String = StringLeaf | StringNode {...}, importedpub use crate::probe_kernelly::{Plain};— String droppedThe second row is the positive control: the filter is live in that run and does drop names, which is what makes the first row a measurement rather than a silence. An alias carries its own
ident_span, not the aliased kernel's — so the substring test already answered correctly there.The kernel binding for a name is constructed with that name's own span (
00_core.dagkernel_span_for), so a cross-name kernel span can only enter an env via a binding substituted across names — which #9850's guard now refuses. The strengthening half is therefore green by construction, and per §4b a permanently-green check is worse than an absent one because it gets cited. It is not claimed as a wall.Witness
emit_import_lines_follow_resolved_binding_identityenrolled inv1.compiler.compiler_tests_rust: the discriminating RED (a kernel-resolved name must not emit a structural use-line shadow) plus two positive controls — a non-kernel import keeps its use-line, and a kernel-spelled name whose kernel binding is structural keeps its use-line, which stops a blanket kernel-name drop.A second witness was written and pulled: it reds.
std.nat's natively-realizedNatemits asRc<Nat>at an explicit importer when an unrelated module declares a recursiveNat. That is not new — it is rostered asgunbc.guarantee_rung_drop two_nat_authorities_stalland #9842 already built the same fixture, so this is an independent third reproduction, not a discovery. It retires by the atomic Nat unification wave ingunbc.plans.dag_v2_defork_auditand by nothing less.Rung drop
emitted_bytes_witness_required_lane— the witness executes inrust-unit-tests, which runs on every push and PR but is not aneedsof the required aggregate, so a regression reddens a visible job without blocking. Trigger named at capability grain: a required-lane capability sufficient to assert, on the real acceptance path, that a namedpub useline is absent for a sole-exporter type resolved to a host-realized kernel scalar and present for a structural kernel carrying a connective.Regen
first_generation_equal=trueon round 2 after rebuilding from the installed seed;--required-regen-fixed-pointreportsfixed_point_equal=true referenced_first_generation_equal=trueat20e5f08. The rebuild is load-bearing — the first pass runs a binary predating the change it emits, so one pass can self-verify at divergence 0 for the wrong reason.Merged
origin/mainrather than rebasing (squash-merge means branch and main share no ancestry for this content). Four generated paths came back unmerged with no conflict markers and ours bytes in the worktree; the compile caught it via main's ownLiteralUnfolding::UnicodeScalarSequenceUnfold. Resolved by regenerating from the merged authority, not by picking a side.