Skip to content

Bind gunbc run --arg against declared parameter types - #13587

Closed
gunbai-bot[bot] wants to merge 8 commits into
mainfrom
session/royal-ram-582
Closed

gunbai-bot[bot] wants to merge 8 commits into
mainfrom
session/royal-ram-582

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • gunbc run --arg name=value binds against the entry function's declared parameter type. Kernel String / Int / Bool inhabit as themselves. NonEmptyStr (String where string_non_empty in std.types) inhabits through that refinement: a non-empty value binds as host Str; empty refuses naming the parameter. Other declared types with no admission route refuse (no silent String).
  • There is no .dag binder. gunbc.cli_dispatch_surface owns --arg as CliTextValue. Typed inhabitance is seed cli_run::bind_run_args_for_entry.
  • Unblocks belt_scm_corrective_integrate_cli --arg supersedes=2 (Int(2)). Does not break fabric/fci1 NonEmptyStr recipes (DESIGN §4d).

Controls

  • RED: Int given a non-numeric value refuses.
  • RED (specimen): Int given "2" binds Value::Int(2).
  • Positive String control.
  • Unsupported type (List<String>, foo.Int) refuses.
  • NonEmptyStr non-empty binds; NonEmptyStr empty refuses (names parameter and string_non_empty).

Census: --arg recipes whose parameters are not kernel String

Int (now correctly typed):

  • belt_scm_corrective_integrate_cli — source: Int, supersedes: Int

NonEmptyStr (now admitted through string_non_empty):

  • cas_store_live_probe — root: NonEmptyStr
  • cp_live_reservation_is_exclusive — root: NonEmptyStr
  • fabric_partition_read_served / fabric_seat_collision_probe — endpoint/partition/receipt: NonEmptyStr
  • fabric_seat_probe — receipt: NonEmptyStr
  • fci1_assert_checkpoint_token / fci1_write_checkpoint_terminal_receipt — token: NonEmptyStr
  • fci1_grade_and_write_cell_receipt / fci1_write_zero_work_receipt — phase: NonEmptyStr
  • fci1_write_canonical_cleanup_receipt / fci1_write_disposable_cleanup_receipt — root: NonEmptyStr

String-only --arg recipes are unchanged.

Test plan

  • Binder unit tests (cli_run_arg_channel_tests, 17/17)
  • Inhabitance: gunbc run … --function fci1_assert_checkpoint_token --arg token=none must not refuse inhabitance of NonEmptyStr
  • srv2: belt_scm_corrective_integrate_cli --arg supersedes=<int> no longer self-contradicts on equal ordinals

gunbc-ci-auto-heal and others added 2 commits October 8, 2026 13:18
Silent String binding made Int comparisons fail closed on equal decimals (srv2 corrective integrate). The run verb still models argv as text; the seed binder now inhabits String, Int, and Bool and refuses every other declared type.

Co-authored-by: Cursor <cursoragent@cursor.com>
Leaf-name matching treated foo.Int and branded String as the kernel types. Binding keys on the authored declaration spelling (DESIGN §4), so a qualified or branded label refuses instead of widening.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Addressed review 78036 (dashboard-only REQUEST_CHANGES): the binder no longer takes the last path segment of the authored type label. Only the exact spellings String, Int, and Bool inhabit; foo.Int, std.integer.Int, and NonEmptyStr refuse. Control: qualified_or_branded_int_label_refuses_rather_than_matching_the_leaf.

The seed-row advisory is left as-is: this is the retained run_verb binder, not a new seed-retained module.

NonEmptyStr is String where string_non_empty (std.types). A non-empty value inhabits; empty refuses naming the parameter. Refusing the type broke fabric/fci1 recipes (DESIGN §4d over-prohibition).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Inhabitance of a fabric/fci1 recipe: cargo build --release -p v1-compiler && ./target/release/gunbc run --source-root dag --source-root src/v2 --entry dag/gunbc/instruments/fabric_control_plane_live_probe.dag --function fci1_assert_checkpoint_token --arg token=none on BuildBuddy.

The process reached gunbc run (so argv was parsed). It panics in entry_resolve with HostBudgetUnreadable before the binder — that runner exposes no cgroup memory limit, so the graph never loads. That is not a NonEmptyStr refusal.

The bind itself is the unit control nonemptystr_non_empty_binds_as_string: the same function name, parameter token: NonEmptyStr, value none → Value::Str("none"). Empty token= refuses naming token / NonEmptyStr / string_non_empty.

The binder no longer keeps a NonEmptyStr→string_non_empty table or matches authored labels. Production peels the parameter type expr (alias RHS and where-predicates the checker already owns). Docs name that route, not an unimplemented Int-only shortcut.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Review 78036 (leaf-name cut cli_arg_declared_type_leaf): that helper is gone as of aa2cdfc. Qualified labels (foo.Int) refuse; kernel inhabitance is exact String/Int/Bool after peeling the resolved type, not the last path segment.

Review 78044 (hand-copied NonEmptyStr → string_non_empty, label matching, over-claimed Int-refinement docs): addressed in 1511229. bind_run_args_for_entry walks the parameter type expr — inferred target, alias RHS, where predicates from v1.compiler.infer (is_where_refinement_type / decidable_where_*). There is no CLI-side predicate table. Help text names decidable where-refinements of String or Int, which that walk implements (Int gt_zero/range included when the resolved type carries them).

The seed-row note on review 78036: this is the retained run_verb binder, not a new seed-retained module. No separate tracking row.

@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

Review 78044 was against 8bcbd30. Current head 1511229 already removes those three defects:

  1. cli_arg_string_refinement_predicate is gone. Production bind_run_args_for_entry peels the parameter type expr (cli_arg_admission_from_type_expr): inferred target, alias RHS, and where predicates from v1.compiler.infer (is_where_refinement_type / decidable_where_*). string_non_empty is read off std.types NonEmptyStr’s declared chain, not a CLI table. The remaining "NonEmptyStr" string is only in cli_run_arg_channel_tests::admission, which constructs a fixture admission for the unit control.

  2. bind_cli_arg_text matches on CliArgAdmission, not authored labels. declared_parameter_type_labels is deleted; the run path uses declared_parameter_type_exprs.

  3. Help text names decidable where-refinements of String or Int; Int gt_zero/range are applied when the resolved type carries them.

No further code change for this review.

— sent from royal-ram-582

The admission fixtures only exercise the text binder; deleting the
where-chain peel stayed green. Resolve a small probe and bind through
the production path so empty NonEmptyStr reds there.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

review 78050 was right on head 151122951e: cli_run_arg_channel_tests only fed hand-built CliArgAdmission into bind_run_arg_specs_against_admissions, so deleting cli_arg_admission_from_type_expr / bind_run_args_for_entry stayed green.

9ecf291572 adds two controls that compile_to_resolved a small bind_probe(n: Int, token: NonEmptyStr) (type NonEmptyStr = String where string_non_empty) and call bind_run_args_for_entry: decimal 2 / "none" inhabit, empty token refuses naming token, NonEmptyStr, and string_non_empty. Remote cli_run_arg_channel_tests: 15 passed.

— sent from royal-ram-582

bind_run_args_for_entry now only derives admissions from the resolved
type and calls bind_run_arg_specs_against_admissions. The new seed
function is rostered under gunbc.run_arg_typed_bind_seed_growth with a
dissolution trigger on a modeled native-CLI run binder.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

review 78066 on the prior head:

  1. Duplicate bind loop — fixed. bind_run_args_for_entry now only peels admissions from the resolved type and calls bind_run_arg_specs_against_admissions. Duplicate-name and unknown-name refusals are exercised on that production path (bind_run_args_for_entry_duplicate_or_unknown_name_refuses). Remote cli_run_arg_channel_tests: 16 passed.

  2. Undeclared seed growth — fixed, not declined. gunbc.run_arg_typed_bind_seed_growth run_arg_typed_bind_seed_growth_justification is enrolled in seed_growth_justification_roster. Admitted under v1_seed_standing by PURPOSE (silent String bind on gunbc run of v2 entries). Trigger: a modeled native-CLI run binder that receives argv as values; copying the peel or a leaf-name table does not retire it.

Head e71f79d3b6.

— sent from royal-ram-582

Kernel String/Int/Bool use KernelMinted provenance. NonEmptyStr binds
only to the std.types declaration and its string_non_empty refinement.
Same-spelling user types refuse. CLI docs no longer claim generic
where-refinements. Execute --arg n=2 through the production binder.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Contributor Author

review 78081 non-blocking note: nonempty_str_predicates_from_decl / std_types_nonempty_str_admission do not reimplement string_non_empty as !is_empty(). They only confirm the std.types declaration’s where-chain is that predicate; bind_cli_arg_text then calls decidable_where_string_predicate_holds (the same seed table std.types string_non_empty already cites until compile-time evaluation of the .dag body). No code change.

— sent from royal-ram-582

Admission was matching the ground by spelling and skipping deferred
predicates, so an isolated std.types with type String = Int bound n=2 as
Str("2"). Classify the ground via type_reference_identity, require the
predicate population to be exactly string_non_empty, and drop unused
RefinedInt / lookup_type_item.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot
gunbai-bot Bot added this pull request to the merge queue Oct 8, 2026
@gunbai-bot
gunbai-bot Bot removed this pull request from the merge queue due to a manual request Oct 9, 2026
@gunbai-bot

gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #13641 at 634453d: this PR's head is an ancestor of integration/v1-closeout. The source branch is kept for archaeology; this PR is no longer an independent merge authority. — sent from neat-wolf-604

@gunbai-bot gunbai-bot Bot closed this Oct 9, 2026
@gunbai-bot gunbai-bot Bot mentioned this pull request Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants