Repository navigation
SG-4b-1 - #609
SG-4b-1#609
Conversation
|
Latest diff read: this stays inside the intended SG-4b-1 bounds. Good signs:
So on scope, this is the right next step after SG-4a. My only direction note is to keep the receipt explicit:
If it stays framed that way, I have no blocker on the current diff from a scope-discipline standpoint. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 004a296c16
ℹ️ 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".
| behavior_output_port, callable_template_arguments, conjunct_leaf_ports, | ||
| declaration_is_callable, is_retryable_generic_decl_walk, predicate_info, | ||
| resolve_template_argument_value, template_argument_value, template_arguments_match, | ||
| walk_to_optional_cardinality_decl, CallableTemplateInfo, PredicateInfo, |
There was a problem hiding this comment.
Regenerate infer helpers before re-exporting new symbols
This pub(crate) use generated::{...} adds exports that do not exist in src/v3/compiler/src/infer_helpers_generated.rs at this commit, so the crate no longer compiles. Running cargo check -p v3-compiler fails with unresolved imports for each newly re-exported item (callable_template_arguments, PredicateInfo, etc.), which makes the change release-blocking until the generated file is updated (or the re-exports are removed).
Useful? React with 👍 / 👎.
briansrls
left a comment
There was a problem hiding this comment.
codex · gpt-5.4 · 004a296c
BLOCKING (1)
Root Cause
src/v3/lenses/infer_helpers.dagthe helper authority grew without regenerating and committing its emitted Rust snapshot -> rerun regen_infer_helpers and land the matching src/v3/compiler/src/infer_helpers_generated.rs update in the same change.
| } | ||
|
|
||
| pub(crate) use generated::behavior_output_port; | ||
| pub(crate) use generated::{ |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
briansrls
left a comment
There was a problem hiding this comment.
codex · gpt-5.4 · 25d65220
BLOCKING (1)
Root Cause
src/v3/lenses/infer_helpers.dagthe reflected helper surface exposes raw d.declarations but not the authoritative total DeclarationId-to-Declaration accessor, so this tranche reconstructs lookup as maybe-missing -> reflect a total declaration-by-id accessor into .dag helpers or keep these lookups in Rust until that accessor exists.
| = MissingTemplateArgument | ||
| | FoundTemplateArgument(DeclarationId) | ||
|
|
||
| type DeclarationLookup |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
briansrls
left a comment
There was a problem hiding this comment.
codex · gpt-5.4 · ff97c723
✅ Review (blocking: 0, non-blocking: 1+/0-)
Non-blocking — Strengths
src/v3/lenses/infer_helpers.dagThe tranche boundary is explicitly documented with concrete deferred helpers and named triggers, so the remaining Rust authority reads as tracked scaffold rather than unbounded debt.
|
✅ Review (blocking: 0, non-blocking: 1+/0-) Non-blocking — Strengths
|
|
Findings
Verdict: REQUEST_CHANGES Nice incremental extraction overall, but I’d fix the declaration lookup authority first. As written, this helper path both bypasses the declared lookup surface and turns structural lookup failure into normal-looking inference results. |
|
claude-review (director) — Verified the SG manager's read on The blockerThe PR introduces: pub enum DeclarationLookup {
MissingDeclaration,
FoundDeclaration { _0: Declaration },
}
pub fn find_declaration(p0: &[Declaration], p1: &DeclarationId) -> DeclarationLookup {
match p0 {
[] => DeclarationLookup::MissingDeclaration,
[__list_head, __list_tail @ ..] => {
if ((__list_head).id == (*(p1))) {
DeclarationLookup::FoundDeclaration { _0: __list_head.clone() }
} else {
find_declaration(__list_tail, p1)
}
}
}
}and consumers downstream match on Problem:
What this lane should have donePer the SG-4a authority map, Cat-1/Cat-2 helpers are structural readers over typed substrate facts that emit typed output. Declaration lookup by id is exactly the kind of thing that should consume The walk-the-Vec pattern is appropriate for the few cases where you're iterating ALL declarations looking for a match by name / shape. For single-id resolution, typed handle access is the right shape. Required before merge
The rest is goodThe chosen tranche (pure walkers, template-argument helpers) matches SG-4a's Cat-1/Cat-2 set. Ready for re-review once the parallel lookup is removed. |
briansrls
left a comment
There was a problem hiding this comment.
codex · gpt-5.4 · a4d6241f
✅ Review (blocking: 0, non-blocking: 0+/0-)
✅ No new concerns in the added lines; this stays within the documented SG-4b-1 slice and clears the earlier projection-drift and declaration-lookup authority problems.
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/gpt-5.4 - Commit:
a4d6241f· Trigger:schedule - Thinking:
305s wall
✅ I do not see new thesis- or invariant-level concerns in the added lines after those two authority problems were removed.
|
Review metadata
FindingsNothing blocking. A couple of small observations worth naming:
The The VerdictAPPROVE — small, narrowly-scoped migration of two pure helpers from |
Briefs for the next wave per SG manager recommendation: - docs/briefs/sg-4b-1-fix-declaration-lookup-cleanup.md (S) — delete DeclarationLookup + find_declaration parallel authority from #609's merged tranche; consumers use Dag::declaration(id). - docs/briefs/sg-3g-b-lower-helpers-wire-in.md (M) — wire 16 expr_span call sites in lower.rs to consume the generated lower_helpers helper from #612's staging. - docs/briefs/sg-2c-2-next-parser-table.md (M-L) — next bounded parser-data extraction from parse_parser_body.txt following SG-2c-1 pattern; item-keyword or punct/operator table. - docs/briefs/1e-2b-class-5-gap-1-or-different-cluster.md (M-XL, decision-first) — retry Lane 1e-2 after #610 miss. Path A: Bool → BooleanAlgebra grounding (Class 5 Gap 1) then logical ops via existing OperatorRealization. Path B: different verified cluster after Phase 0 verification. ROADMAP debt rows added to "Post-merge debt (2026-04-21 receipt-closure wave)": - Class 5 Gap 1 (Bool grounding) — owner 1e-2b Path A - emit_rust_module SurfaceLiteral→LiteralBits rename gap (from #612) - emit_rust_module render_variant_constructor tuple variant gap (from #612) - SG-4b-1 DeclarationLookup parallel authority (from #609 override) Receipt-closure wave posture: no full-file retirement, no walker collapse, no new XXL umbrella lanes without verified clusters. Closes design debts surfaced by prior wave; validates patterns end-to-end on small slices before next step-function dispatch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…anup Codex reviewer correctly flagged: find_declaration / DeclarationLookup are NOT in infer_helpers.dag / infer_helpers_generated.rs on main. Those files were cleaned up independently after #609; they now contain only TemplateArgumentLookup. The pattern DOES persist on main — in `src/v3/lenses/variant_payload.dag`: type DeclarationLookup = LookupMissing | LookupFound(Declaration) fn find_declaration(decls: List<Declaration>, target: ...) -> DeclarationLookup = ... Same concerns (parallel O(n) walk vs Dag::declaration; fail-open vs fail-closed C-8) — just different file. Variant names are slightly different (LookupMissing / LookupFound vs MissingDeclaration / FoundDeclaration) reflecting the separate author path. Updates: - ROADMAP debt row now cites variant_payload.dag - SG-4b-1-fix brief retargeted: Read first, Context, Work, Acceptance all point at src/v3/lenses/variant_payload.dag - Acceptance now includes a sanity grep confirming zero hits post-cleanup - The "originally surfaced via #609; that file cleaned up independently; pattern persists in variant_payload.dag" framing makes the migration context honest The underlying work is unchanged in shape: delete the parallel authority, consume the canonical Dag::declaration accessor, treat missing-id as a substrate-integrity violation not a normal lens outcome. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
SG-4b-1 prototype tranche.
This PR takes a bounded Cat-1/Cat-2 helper slice through the existing
infer_helpers.dag -> infer_helpers_generated.rs -> infer.rspath. It is not full SG-4 and does not claiminfer.rsretirement.Moved into
.dagauthority in this tranche:template_argument_valueresolve_template_argument_valueRetained generated helper already on this path:
behavior_output_portGenerated output is committed in the same PR and consumed from the real inference path.
Remaining authoritative in
infer.rs:predicate_infoandcollect_conjunct_leaves.walk_to_optional_cardinality_decl,callable_template_arguments,declaration_is_callable,is_retryable_generic_decl_walk,template_arguments_match.infer.rs.Why the remainder stayed in Rust:
walk_to_optional_cardinality_declandcallable_template_argumentsare not moved because the current reflected helper surface does not expose the canonical totalDag::declaration(id)accessor, and rebuilding lookup in.dagwould introduce parallel authority.predicate_infois not moved because the current reflectedBindNodehelper path does not expose the needed predicate-body fact honestly.is_retryable_generic_decl_walkis not moved because the current lens termination checker cannot prove its mutual-recursion cluster.declaration_is_callableandtemplate_arguments_matchare not moved because this helper emission path currently generates invalid Rust for those bool-returning helpers.Verification run on this branch:
cargo run -p v3-compiler --bin regen_lens -- --lens infer_helperscargo fmt --all --checkcargo clippy -p v3-compiler --all-targets -- -D warningscargo test -p v3-compiler sg6_infer_helpers_generated_module_matches_checked_in_snapshot -- --nocapturecargo test -p v3-compiler infer -- --nocapture