Skip to content

C source emitter Stage 0: author minimal c_target_model + run_c_smoke harness — emit 'int add(int,int){return x+y;}' + main, cc-compile, run, assert, --inject-fault RED - #6770

Merged
briansrls merged 8 commits into
mainfrom
session/merry-heron-533
Jul 16, 2026

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Auto-opened by session-dashboard for session merry-heron-533.
Pushing to session/merry-heron-533 advances this PR.

Worker attestation

Before flipping this PR to ready for review, confirm each item:

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why (replace the TODO below).
  • Tests run: name the command (e.g. npm test, cargo test) and the result.
  • If this closes a work item, the body contains a Closes #N directive.
  • No commits on this branch are surprises (no fork/cherry-pick I did not make).
  • No secrets / credentials / large binaries staged.

Summary

TODO: replace this paragraph with one or two sentences naming the change and its motivation. Reviewers read this first.

Test plan

  • TODO: list the commands that ran (or "no tests changed; relied on CI") and the outcome.

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 16, 2026 19:55
@cursor

cursor Bot commented Jul 16, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Addressed review 39074 (coverage-completeness counter) in 10bd135 / 00126feb:

Finding verified — valid. emit_host_gate_declared_smoke_count had been bumped to 6, but emit_host_present_target_count() still counts only TargetModels with a configured runtime_row (rust, python, go, typescript, c → 5). cpp was demoted to target_emit_host_runtime_row_unconfigured; c replaces it rather than adding a sixth present target. The gate runs six smokes (including node_http, which is not a TargetModel runtime row), but the completeness invariant is present-target cardinality, not literal gate smoke invocations — same as on main where gate-only node_http and gate-excluded cpp cancelled to 5 == 5.

Fix: reverted emit_host_gate_declared_smoke_count to 5 in target_coverage_completeness_test.dag:87.

Also landed in the same commits (parent review follow-up, not blocking 39074):

  • c_add_emit_translate_test.dag — emit/serialize translate witness + RED controls (missing translation rules, wrong node)
  • c_cpp_realization_relationship_note on c.dag carrier

Port the wire-discipline RED controls from the deleted cpp_add_emit_host_run
test onto c_add_emit_host_run_test so C inherits the same FixedWidthBytes
refusal coverage after cpp demotion to unconfigured runtime_row.

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

review 39075 — findings verified on current branch:

  1. §3 nicknaming (c_source_text ≡ cpp_source_text) — accurate; already tracked on carrier via c_cpp_realization_relationship_note (c.dag:288) with dissolution trigger naming cpp re-home onto c / shared c_subset. No additional change in this PR — intentional 🟡 frontier, not a silent fork.

  2. Byte-width RED coverage regression — valid flag. The deleted cpp_add_emit_host_run_test carried nonzero_exit + byte_width_mismatch wire-discipline REDs; initial c test only had green + inject-fault. Fixed in latest commit: ported both REDs to c_add_emit_host_run_test.dag via c_fixed_source_row (same cc/FiveWidthBytes pattern as the former cpp test). cpp remains honestly host_smoked: false with target_emit_host_runtime_row_unconfigured.

  3. Transport vs execution test duplication — confirmed; matches established emit-host pattern (gate transport in dag/tools/emit_host_transport.dag, execution witness in src/v2/test/claim/execution/*_emit_host_run_test.dag). Not introduced here.

Thanks for the APPROVE.

Drop the `value != 5` guard from c_emit_host_inject_fault_main_suffix so
add(2,2) emits [0,4,0,0,0] and exercises the FixedWidthBytes compare path
advertised in c_emit_host_smoke_red_doc. Tighten inject-fault witnesses to
refuse on nonzero-exit alone.

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

review 39081 — findings verified:

  1. §2 fixture duplication (emit_host_transport.dag vs c_add_emit_host_run_test.dag) — accurate; intentional gate-side Bool wrapper vs executor-side test fn split, same shape as other emit-host languages. Agreed this is Stage-1 consolidation when a second cc-runtime language reuses the fixture surface — not blocking here.

  2. Weak inject-fault discrimination — valid. The value != 5 guard made add(2,2) exit before writing stdout, so RED passed via nonzero-exit rather than octet mismatch (despite c_emit_host_smoke_red_doc claiming the latter). Fixed in latest commit: removed the guard from c_emit_host_inject_fault_main_suffix so fault path emits [0,4,0,0,0] vs green oracle [0,5,0,0,0]; inject-fault witnesses now refuse on nonzero-exit alone.

Thanks for the APPROVE.

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

review 39087 — verified on current branch (0d8b232):

All affirmations hold: C Stage-0 mirrors the established emit-host pattern; inject-fault RED discriminates via stdout octet mismatch (add(2,2) → [0,4,0,0,0] vs green oracle [0,5,0,0,0]); main suffix carries c_emit_host_main_suffix_dissolution_trigger; cpp demoted to target_emit_host_runtime_row_unconfigured with host_smoked: false; §3 nicknaming tracked in c_cpp_realization_relationship_note. No code changes requested — acknowledged.

— sent from merry-heron-533

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

review 39088 — verified on current branch (0d8b232):

All affirmations hold: c_target_model owns grammar rows, lex, binding_spellings, and cc runtime_row; cpp correctly uses target_emit_host_runtime_row_unconfigured; scaffolds carry named dissolution triggers; smoke/execution witnesses include inject-fault octet mismatch, nonzero-exit, and byte-width RED controls. No merge-blocking issues identified — acknowledged.

— sent from merry-heron-533

run_c_smoke_holds invoked emit_host_run_transport in the hermetic discovery
batch, which refuses host process execution. C smoke is already exercised
wet via emit_host_gate_passes; move the RED doc onto emit_host_transport.

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

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

review 39092 — verified on current branch (7292c5f):

No findings to address. All affirmations hold post-CI fix: grammar/lex/binding on c_target_model, cpp unconfigured, wet C smoke via emit_host_gate_passes/run_c_smoke() (green + inject-fault octet RED), hermetic translate tests in manual/, execution witnesses in offline execution/ lane, dissolution triggers + c_cpp_realization_relationship_note in place. The hermetic c_emit_host_smoke_test.dag witness was removed in 7292c5f (gate is the wet consumer).

— sent from merry-heron-533

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

review 39093 — verified on current branch (7292c5f):

No findings to address. Affirmations hold: c_cpp_realization_relationship_note (c.dag:620) names the §3 nicknaming risk + dissolution condition; cpp uses target_emit_host_runtime_row_unconfigured; gate signature/coverage/inject-fault RED consistent; main-suffix scaffolds carry c_emit_host_main_suffix_dissolution_trigger (c.dag:628).

— sent from merry-heron-533

@briansrls
briansrls merged commit b4f9c40 into main Jul 16, 2026
3 checks passed
@briansrls
briansrls deleted the session/merry-heron-533 branch July 16, 2026 23:20
briansrls pushed a commit that referenced this pull request Jul 16, 2026
Take main's cpp.dag and emit_host_gate target_coverage imports (#6770
C emitter landing). Rebases branch tip onto current main.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 16, 2026
Main advanced with #6770 (C emitter), #6750 (shell->dag slice 4),
#6757 (self-emit flip). Two import-header conflicts resolved
import-stripped: cpp.dag, target_coverage_completeness_test.dag.
C target coverage row auto-merged in test body.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Jul 16, 2026
Rebase session/census-pre-resolve onto current main (linear history).

- Option 2 pre-resolve: ground_global_bare_census with lazy-recursive
  global_bare_lookup (memo + in_progress cycle guard, §5 order-independence)
- GlobalBareUniqueBinding gains defining_module; receipt (a) equivalence tests
- Shared-layer M×K→M+K variant locals (#6773) + cli_run corpus grounding
- Namespace import-strip integration collapsed from strip PRs
- Merge main: restore cpp.dag + emit_host_gate imports (#6770)

Co-authored-by: Cursor <cursoragent@cursor.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