Skip to content

Bash dissolution slice 5d (Exit — LAST emit-vocab construct): migrate ShellStmt Exit{code:Int} (renders 'exit <code>', e.g. 'exit 1'; live consumer dsl/tools/host_prelude.dag) from the serialize_bash sidecar into a v2 emit row. READ FIRST memory bash-sidecar-dissolution-arc-ownership §5d DISPATCH BR - #5347

Merged
briansrls merged 2 commits into
mainfrom
session/still-eagle-679
Jun 20, 2026

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add v2 bash emit rows for Exit { code: Int } — the last emit-vocab construct in the bash sidecar dissolution arc.
  • Fixtures cover exit 1 (host_prelude OrElse failure arm), exit 0 (dsl_compile_clean_transport success path), and a discriminating quoted-wrong RED witness (exit '1' vs bare exit 1).
  • Execution witnesses in bash_emit_command_test.dag prove byte-identity with serialize_bash for each row.

Test plan

  • gunbc run --source-root src/v2 --source-root dsl --entry src/v2/compiler/manual/bash_emit_command_test.dag --function bash_emit_exit_code_1_holds --claim-run
  • gunbc run --source-root src/v2 --source-root dsl --entry src/v2/compiler/manual/bash_emit_command_test.dag --function bash_emit_exit_code_0_holds --claim-run
  • gunbc run --source-root src/v2 --source-root dsl --entry src/v2/compiler/manual/bash_emit_command_test.dag --function bash_emit_exit_code_1_quoted_wrong_model_holds --claim-run
  • gunbc run --source-root src/v2 --source-root dsl --entry src/v2/compiler/manual/bash_emit_command_test.dag --function bash_emit_exit_code_1_wrong_quoted_model_rejects_holds --claim-run

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review June 19, 2026 23:13
@briansrls
briansrls merged commit b9386b8 into main Jun 20, 2026
2 of 3 checks passed
@briansrls
briansrls deleted the session/still-eagle-679 branch June 20, 2026 01:12
briansrls added a commit that referenced this pull request Jun 20, 2026
…ot the undefined bash_lex_rule (main-red fix)

#5347 (slice 5d Exit) left `bash_exit_code_lex()` calling a `bash_lex_rule(...)`
constructor that is defined nowhere in the tree. The whole-tree CI floor resolves
every *_test.dag closure, so this dangling call failed `resolve` for
bash_emit_command_test.dag and turned main RED for every open PR (since #5347
merged at 01:12 UTC; pre-#5347 5c493fc was green).

Fix per §3 single authority (lexing.dag LexicalPhrase): the lex rule set PROJECTS
from the construct's FIXED-spelling spans via `phrase_to_lex_rules(p: phrase([...]))`,
exactly as the bound-token sibling `bash_env_prefixed_cargo_lex` does — NOT a direct
rule constructor (the "authored three times that could silently disagree" anti-pattern).
Only the `exit ` keyword is a fixed span; the exit code is an emit-time BOUND token
(^bash_token_exit_code via binding_spellings), so it contributes no literal lex rule —
preserving the original single-rule behavior bit-for-bit.

NOTE: this is a tighter fix than the two-span suggestion (incl. the code span) —
a LexicalPhrase is fixed-spelling-only by contract, so the bound code cannot be a
span; a literal span for it would over-generate a spurious rule. Confirmed with the
bash arc owner (warm-badger-46) who also cleared the colliding bash_lex_rule
constructor in #5363.

Verified by execution (prebuilt claim_batch, --source-root dsl --source-root src/v2):
  - bash_emit_command_test.dag now RESOLVES clean (43 modules, was resolve-FAIL)
  - bash_emit_command_accepts / bash_emit_bound_words: PASS
  - bash_emit_exit_code_{0,1}: PASS
  - bash_emit_exit_code_1_quoted_wrong_{ne_correct,model,rejects}: PASS (discriminating RED intact)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 20, 2026
…ot the undefined bash_lex_rule (main-red fix)

#5347 (slice 5d Exit) left `bash_exit_code_lex()` calling a `bash_lex_rule(...)`
constructor that is defined nowhere in the tree. The whole-tree CI floor resolves
every *_test.dag closure, so this dangling call failed `resolve` for
bash_emit_command_test.dag and turned main RED for every open PR (since #5347
merged at 01:12 UTC; pre-#5347 5c493fc was green).

Fix per §3 single authority (lexing.dag LexicalPhrase): the lex rule set PROJECTS
from the construct's FIXED-spelling spans via `phrase_to_lex_rules(p: phrase([...]))`,
exactly as the bound-token sibling `bash_env_prefixed_cargo_lex` does — NOT a direct
rule constructor (the "authored three times that could silently disagree" anti-pattern).
Only the `exit ` keyword is a fixed span; the exit code is an emit-time BOUND token
(^bash_token_exit_code via binding_spellings), so it contributes no literal lex rule —
preserving the original single-rule behavior bit-for-bit.

NOTE: this is a tighter fix than the two-span suggestion (incl. the code span) —
a LexicalPhrase is fixed-spelling-only by contract, so the bound code cannot be a
span; a literal span for it would over-generate a spurious rule. Confirmed with the
bash arc owner (warm-badger-46) who also cleared the colliding bash_lex_rule
constructor in #5363.

Verified by execution (prebuilt claim_batch, --source-root dsl --source-root src/v2):
  - bash_emit_command_test.dag now RESOLVES clean (43 modules, was resolve-FAIL)
  - bash_emit_command_accepts / bash_emit_bound_words: PASS
  - bash_emit_exit_code_{0,1}: PASS
  - bash_emit_exit_code_1_quoted_wrong_{ne_correct,model,rejects}: PASS (discriminating RED intact)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jun 20, 2026
…errors (#5363)

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* Fix missing bash_lex_rule exposed by parse-resilient resolve.

Slice 5d exit-code lex rules call bash_lex_rule but the helper was never
defined; whole-tree discovery now reaches resolve and failed on bash.dag.

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

* Drop out-of-scope bash_lex_rule hotfix from parse-resilience PR.

§3-correct lex authority fix lands separately on main (eager-boar-790);
keep #5363 scoped to front_end_sources only (compile.dag + stage0 seed + test).

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

* hotfix(bash): bash_exit_code_lex projects from a fixed-span phrase, not the undefined bash_lex_rule (main-red fix)

#5347 (slice 5d Exit) left `bash_exit_code_lex()` calling a `bash_lex_rule(...)`
constructor that is defined nowhere in the tree. The whole-tree CI floor resolves
every *_test.dag closure, so this dangling call failed `resolve` for
bash_emit_command_test.dag and turned main RED for every open PR (since #5347
merged at 01:12 UTC; pre-#5347 5c493fc was green).

Fix per §3 single authority (lexing.dag LexicalPhrase): the lex rule set PROJECTS
from the construct's FIXED-spelling spans via `phrase_to_lex_rules(p: phrase([...]))`,
exactly as the bound-token sibling `bash_env_prefixed_cargo_lex` does — NOT a direct
rule constructor (the "authored three times that could silently disagree" anti-pattern).
Only the `exit ` keyword is a fixed span; the exit code is an emit-time BOUND token
(^bash_token_exit_code via binding_spellings), so it contributes no literal lex rule —
preserving the original single-rule behavior bit-for-bit.

NOTE: this is a tighter fix than the two-span suggestion (incl. the code span) —
a LexicalPhrase is fixed-spelling-only by contract, so the bound code cannot be a
span; a literal span for it would over-generate a spurious rule. Confirmed with the
bash arc owner (warm-badger-46) who also cleared the colliding bash_lex_rule
constructor in #5363.

Verified by execution (prebuilt claim_batch, --source-root dsl --source-root src/v2):
  - bash_emit_command_test.dag now RESOLVES clean (43 modules, was resolve-FAIL)
  - bash_emit_command_accepts / bash_emit_bound_words: PASS
  - bash_emit_exit_code_{0,1}: PASS
  - bash_emit_exit_code_1_quoted_wrong_{ne_correct,model,rejects}: PASS (discriminating RED intact)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* test(#5363): discovery advisory classification + execution receipt.

Unit test pins is_discovery_corpus_blocking_diagnostic boundary (typecheck
advisory vs parse/resolve hard-fail). Ignored receipt proves 255 discovery
entry resolves green with advisory gate (0 failures).

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

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* fix(#5363): scope advisory gate to discovery-only resolve entry points.

Thread ResolveTypecheckGate through resolve paths: Strict default on
resolve_entry_with_index / compile consumers; DiscoveryCorpusAdvisory only
via resolve_entry_with_index_for_discovery_corpus and discover_owned_data_decls.
Fixes compile error (CompilerDiagnostic import) from prior scope commit.

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

* chore(#5363): drop bash.dag from PR — fix already on main (#5356).

Rebased onto green main; bash_exit_code_lex phrase projection is upstream.

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

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* fix(#5363): satisfy clippy in parse-cache resilience test.

rust_monolith_gate runs cargo clippy --all-targets -D warnings; use
from_ref instead of cloned slice literal for build_multi_entry_index.

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

* WIP: front_end_sources PARSE-RESILIENCE root fix: a parse error in ONE file m

* fix(#5363): discovery advisory gate must retain typed graph in merged resolve.

resolved_graph_from_sources called compile_to_resolved, which nils graph on
any typecheck error even when DiscoveryCorpusAdvisory would demote them —
breaking discover_owned_data_decls. Thread the gate through a gated compile
path so advisory-only typecheck debt still returns a ResolvedGraph.

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

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant