Skip to content

Fix DESIGN §4c body-position source annotation violations (2 blocks) - #7918

Merged
briansrls merged 2 commits into
mainfrom
fix/annotation-body-position-nvidia-drift-test
Aug 6, 2026
Merged

briansrls merged 2 commits into
mainfrom
fix/annotation-body-position-nvidia-drift-test

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Two // annotation blocks sat inside a declaration body instead of at module-item grain (DESIGN §4c: "The initial .dag realization admits only standalone leading // blocks attached to module-scope declarations; trailing, body, unattached, and block-comment forms refuse until separately modeled"):

  • dag/extdeps/systems/nvidia.dag — a note on dgx_spark_catalog_row's memory/memory_bandwidth field derivation, sitting inside the record-literal body.
  • dag/test/claim/generated_artifact_drift_test.dag — a note on the third clause of witness_refusal_cause_tokens_are_pairwise_distinct's fold_list cons lambda, sitting inside the fn body.

Both are lifted above their enclosing declaration, with the specific field(s)/clause they describe named explicitly in the new text (since position no longer pins the meaning once it moves), and both keep their original review citations (review 49122, review 49204) verbatim. Per DESIGN §4c, neither was moved into a data _note: String row — that would itself be the "ordinary String declaration whose sole purpose is commentary is misplaced or dead data" anti-pattern the section calls out.

Population closure

A corpus-wide search for indented (body-position) // lines:

find dag src/v2 -name '*.dag' -print0 | xargs -0 grep -nP '^[ \t]+//'

found exactly these 2 blocks (9 lines total) before this change, and zero matches after. No third site exists anywhere in dag/**/*.dag or src/v2/**/*.dag — the violation class is closed to empty, not merely reduced by the two instances noticed.

Why this was invisible on main

The exposing witness, compile_clean_shard_a_exemplar_compile_green (dag/test/claim/dag_compile_clean_shard_a_witness_test.dag), self-compiles the whole corpus regardless of its staged single-file entry stub. It is normally selection-skipped on main pushes:

run 31077711827, job log:
[wet-witness-row-outcome] batch=4 entry=dag/test/claim/dag_compile_clean_shard_a_witness_test.dag
  function=compile_clean_shard_a_exemplar_compile_green outcome=selection-skipped
  detail=skip-before-resolve-fast-path

So the violation had been sitting unexecuted on main, not previously passing. It only surfaced because a downstream PR's (#7905) affected-set happened to select this witness.

Secondary finding: duplicate diagnostic ranges

The compiler reported 9 diagnostic ranges for these 2 blocks (4 overlapping ranges for the nvidia.dag block, 5 for the drift-test block) — a duplicate/overlapping-range artifact per block, not 9 distinct violations. Noted here as a secondary finding, not the headline; not addressed by this PR.

Verification

  • gunbc compile --source-root dag --source-root src/v2 --source-root src/v1 --dependency-pool-index primary-precedence --target dag over the full corpus: previously 9 hard diagnostics, now 0.
  • compile_clean_shard_a_exemplar_compile_green via claim_batch --wet: now PASS.

Scope note

This is deliberately separate from PR #7905 (session/royal-boar-445, "Refuse autocommit while index has unmerged stages"), which remains blocked on this unrelated CI failure and is left untouched.

🤖 Generated with Claude Code

gunbc-ci-auto-heal and others added 2 commits August 6, 2026 12:07
Two `//` annotation blocks sat inside a declaration body instead of at
module-item grain: nvidia.dag's memory/memory_bandwidth derivation note
(inside dgx_spark_catalog_row's record literal) and
generated_artifact_drift_test.dag's fold_list cons-clause note (inside
witness_refusal_cause_tokens_are_pairwise_distinct's body). Both are
lifted above their enclosing declaration with the specific field/clause
they describe named explicitly, so the meaning doesn't drift now that
position no longer pins it. Citations (review 49122, review 49204)
preserved verbatim.

Population closure: a corpus-wide search for indented `//` lines
(`find dag src/v2 -name '*.dag' -print0 | xargs -0 grep -nP '^[ \t]+//'`)
found exactly these 2 blocks (9 lines) before this change and zero
matches after — no third site exists anywhere in dag/**/*.dag or
src/v2/**/*.dag.

Why this was invisible on main: the exposing witness,
compile_clean_shard_a_exemplar_compile_green, is normally
selection-skipped on main pushes (run 31077711827:
outcome=selection-skipped detail=skip-before-resolve-fast-path) because
it self-compiles the whole corpus regardless of its staged entry stub.
It only ran because a downstream PR's affected-set happened to select
it, surfacing a violation that had been sitting unexecuted, not
previously passing.

Secondary finding: the compiler reported 9 diagnostic ranges for these
2 blocks (4 for the nvidia.dag block, 5 for the drift-test block) --
duplicate/overlapping ranges per block, not 9 distinct violations.

Verified: `gunbc compile --target dag` over the full corpus now
produces zero hard diagnostics (previously 9), and
compile_clean_shard_a_exemplar_compile_green now PASSes via
claim_batch --wet.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…push_refusal_cause_token

review 49510 caught that the relocated annotation misattributed the
fold whose sentinel-collision the comment describes. The fold lives in
refusal_causes_token (dag/gunbc/heal_push_plan.dag:491-502), not
heal_push_refusal_cause_token -- a per-cause helper the fold calls, not
the fold itself. No §4c or behavioral issue; wording only.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@briansrls
briansrls merged commit 0b0e683 into main Aug 6, 2026
5 checks passed
@briansrls
briansrls deleted the fix/annotation-body-position-nvidia-drift-test branch August 6, 2026 16:33
gunbai-bot Bot pushed a commit that referenced this pull request Aug 6, 2026
Unblocks this branch per smart-badger-549 — the compile_clean_shard_a
witness failure that reddened prior CI runs was caused by unrelated
DESIGN §4c annotation violations, now fixed on main via #7918.
gunbai-bot Bot pushed a commit that referenced this pull request Aug 6, 2026
Merge ref now includes the nvidia and generated_artifact_drift_test fixes;
cit-1 carries no independent duplicate of those hoists.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Aug 7, 2026
* CIT-1: RFC 8118 safe profile, navigable projection, x86_64 consumer.

extdeps.standards.rfc_8118 carries ISO 32000-2 as further_citation with
normative-relationship note. Safe profile admits page (PositiveInt),
nameddest, structelem only; all other section-3 parameters refuse via
ParameterOutsideCit1SafeProfile typed arms. sysv_amd64 is the versioned
PDF consumer using Pin<CitedRepresentation> and pin_currency_gap — no
parallel currency surface. 11/11 hermetic witnesses green.

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

* Refuse project_navigable_uri when base locator already has fragment.

NavigableUriProjection returns NavigableUriRefused {
BaseLocatorAlreadyCarriesFragment } instead of synthesizing a second #.
Dissolve-on note binds to extdeps.uri fragment decomposition. Witness
split note cites decl_ref_constructor_authority_note homonym. 14/14
CIT-1 witnesses green.

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

* WIP: Rich PDF citation anchors

* Admitted-only PDF parameter sequences; refuse at construction.

Remove ProfileRefused from PdfProfileParameter. Refusal is
ParameterConstructionRefused at pdf_open_* construction time;
pdf_open_parameter_sequence refuses the whole sequence if any
construction is refused. project_navigable_uri propagates
ParameterConstructionRefusedInSequence — no silent drop at wire
fold. 16/16 CIT-1 witnesses green.

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

* Narrow pdf_open_parameters_include_page to admitted sequences only.

Predicate takes PdfOpenParameterSequence, not
PdfOpenParameterSequenceConstruction — refusal cannot collapse to false.
Callers resolve construction before asking whether a built sequence
includes a page. 16/16 CIT-1 witnesses green.

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

* Collapse PDF parameter sequence construction to one fold.

first_refusal and collect_admitted duplicated the same refusal fact across
two list traversals; the second pass kept a dead skip arm that could
reintroduce silent drops if called directly. One fold now returns
SequenceConstructed or SequenceConstructionRefused on first refusal.

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

* WIP: Rich PDF citation anchors

* WIP: Rich PDF citation anchors

* WIP: Rich PDF citation anchors

* WIP: Rich PDF citation anchors

* WIP: Rich PDF citation anchors

* WIP: Rich PDF citation anchors

* Propagate PDF parameter encode refusals through navigable URI projection.

Replace REFUSED magic-string wire termination with construction coproducts
from parameter wire through sequence wire to NavigableUriRefused, with RED
witnesses for scalar encode refusal and projection routing.

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

* WIP: Rich PDF citation anchors

* Assert sysv_amd64 consumer refusal survives terminal projection.

Consumer witnesses now match navigable-uri and citation-selector constructions directly, including a RED that plants an unencodable nameddest and expects X86_64AbiPdfNavigableUriRefused at the sysv_amd64 consumer boundary.

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

* Lift sysv_amd64 fixture rows to construction coproduct types.

Fragment selectors, expected digest, pin, citation fact, and evidence link now declare construction types so refused paths are legal values instead of recursion, fabricated causes, or observed:none absorption. Consumers match on the coproduct end-to-end.

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

* Spell out exhaustive construction arms in evidence-link witnesses.

Replace wildcard false arms with explicit refused variants so new coproduct arms fail to compile instead of silently answering false.

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

* Fix uri.dag after cit-1 rebase: keep cit-0/#7790 authority.

Drop conflict markers and superseded pre-#7790 encoder fork; CIT-1 consumes extdeps.uri percent-encode from main.

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

* WIP: Rich PDF citation anchors

* WIP: Rich PDF citation anchors

* WIP: Rich PDF citation anchors

* Fix cit0 fragment_selector matches to unwrap CitationSelectorConstruction.

Compile-clean refused matching FragmentSelectorVariant directly on
fragment_selector's construction return type; wrap with
CitationSelectorConstructed like text_position_selector witnesses already do.

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

* Route nameddest scalar-code-point helper through RFC wire projection.

Consume pdf_open_nameddest_wire_from_scalar_code_points encoded output
instead of re-encoding the unrelated name parameter on the success arm.

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

* Propagate SelectorRefusalCause from pdf_open_fragment_selector.

Replace fabricated PdfOpenParameterPercentEncodeRefused arm with
CitationSelectorConstructionRefused on NavigableUriRefusalCause so
selector construction refusals reach callers unchanged.

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

* Fix nameddest equals witness to expect RFC 3986 uppercase hex.

Hand-spelled expectation nameddest=a%3Db matches uri_hex_nibble_wire
uppercase emission for the equals byte; not derived from the encoder.

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

* Move dgx_spark_catalog_row comment out of record body.

v2 self-compile refuses source annotations inside declaration bodies;
this blocked compile_clean_shard_a_exemplar_compile_green on CI batch 4.

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

* Revert "Move dgx_spark_catalog_row comment out of record body."

This reverts commit 81b9c18.

* Trigger CI after main #7918 body-position annotation hoists.

Merge ref now includes the nvidia and generated_artifact_drift_test fixes;
cit-1 carries no independent duplicate of those hoists.

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

* Fix four operator blockers on CIT-1 citation consumer.

Point syscall convention citation at physical page 125 with page-28 RED
control; split pin-establishment and retrieval provenance across distinct
run_identity values; refuse malformed receipt hex as WetReceiptHexMalformed
instead of fabricating HTTP 400; replace concat wire fold with map-then-join.

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

* Close blocker 2: emit IndependentExpectedPinUnavailable.

Remove duplicate authored receipt hex literals and the self-joining
pin/retrieval reconcile path. Pin construction refuses with
IndependentExpectedPinUnavailable; syscall citation stays below the
digest-matched rung until a real independent retrieval lands.

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

* Trigger CI at 16f5081 after blocker-2 closure.

Empty commit to produce a pull_request run covering the head with
IndependentExpectedPinUnavailable and zero authored receipt hex literals.

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

* Re-trigger pull_request CI after PR reopen.

Prior synchronize at 8d84729 produced no workflow run after the
superseded a30f787 run was cancelled; reopen + empty commit to force
pull_request coverage at current head.

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

* Trigger pull_request CI (PR now ready for review).

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

* Restore conforms_to authority checks in cit0 fragment selector witnesses.

Review 49636: pdf_fragment_selector_conforms_to_rfc_8118_not_web_annotation
and pdf_fragment_selector_red_wrong_conforms_to_web_annotation compared wire
values only; restore locator equality on conforms_to and cross-authority
discriminators so a Web Annotation fixture cannot pass as RFC 8118.

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

* Restore conforms_to binding in x86_64 consumer fragment selector witness.

Review 49644: x86_64_abi_syscall_citation_selector_conforms_to_rfc_8118
compared wire value only; assert conforms_to.uri.locator matches RFC 8118
§3 authority and differs from the cited PDF document authority.

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

* Split x86_64 ABI citation consumer out of extdeps into gunbc layer.

Review 49655: move citation facts, evidence links, wet observations, and
pdf_safe_profile wiring to gunbc.citation.x86_64_abi_pdf_consumer; extdeps
runtime.abi.sysv_amd64 retains upstream PDF identity, edition, and register
calling-convention facts only. Removes extdeps→gunbc dependency inversion.

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

* Fix consumer witness failures from cross-module data init order.

After splitting sysv_amd64 from gunbc.citation.x86_64_abi_pdf_consumer,
module-level data rows that projected navigable URIs and syscall fragment
selectors initialized before extdeps authority facts were ready. Evaluate
those paths via functions at call time instead.

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

* Convert x86_64_abi_pdf_authority to fn for cross-module init order.

The extdeps→gunbc consumer split made x86_64_abi_pdf_authority a data row
aliasing extdeps_external_authority_anchor that was read across a module
boundary; at init time the alias could read as default-empty, breaking all
three URI/selector witnesses that depend on the base locator. Evaluating
the authority at call time dissolves the cross-module data-init dependence.

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

* Invert ABI PDF authority alias so the literal lives on the unique name.

Put the refspecs locator on x86_64_abi_pdf_authority and point
extdeps_external_authority_anchor at it, so cross-module consumers
bind the globally unique symbol instead of the ~300-way homonym.

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

* Put literal on extdeps anchor; fn accessor for cross-module PDF authority.

The alias inversion (879b909) passed ExtdepsExternalAuthorityGate but
redded corpus_live_clean_tree_wall_holds — the mandatory-tag projection
requires a literal on extdeps_external_authority_anchor, not an alias
(same measured constraint as posix_authority_duplication_note). Plan B:
literal on the gate row, x86_64_abi_pdf_authority() returns the local
anchor for consumers without homonym shadowing.

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

* Delete PDF authority nickname; explicit anchor import in consumer.

Literal stays on extdeps_external_authority_anchor (corpus wall needs
inline scheme). Consumer imports that anchor from sysv_amd64 explicitly.
Witness second conjunct uses x86_64_abi_pdf_identity.access_route to
avoid importing two homonymous anchor names.

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

* Add diagnostic probes for citation base URI and conforms conjuncts.

Instrument before further authority-shape guesses: base-locator probe
via consumer import path, empty-base projection probe, and three
split witnesses naming which conforms conjunct fails.

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

* Disambiguate ABI PDF anchor reads with qualified module paths.

Bare extdeps_external_authority_anchor resolves to the wrong module
(~300-way homonym); use extdeps.runtime.abi.sysv_amd64-qualified
references in the consumer and identity row. Probe run confirmed:
base locator correct, empty-base ruled out, all three conforms
conjuncts pass. Remove the diagnostic empty-base probe.

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

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: gunbai-bot[bot] <289086189+gunbai-bot[bot]@users.noreply.github.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