Skip to content

fix(cue): mark the three #Opaque uses in bind.cue with their S10 reason - #361

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/bind-opaque-s10
Nov 17, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/bind-opaque-s10

Conversation

@aitrawog

Copy link
Copy Markdown
Contributor

Summary

D-PAT-1 requires that every use of #Opaque mark itself // S10 on the line that uses it, because
an open struct is otherwise indistinguishable from a typo-tolerant shape. The three uses in
schema/bind.cue carried their reason only in the definition's doc comment — which the census does
not read — so design-dpat counted them as findings:

FAIL spec/schema/bind.cue:32: opaque: a #Opaque use with no // S10 marker — mark the line, or type
     the field (D-KIND-5)
FAIL spec/schema/bind.cue:51: opaque: ...
FAIL spec/schema/bind.cue:57: opaque: ...

That is why opencharly/opencharly could not pin past af9c505429fe: its pre-push gate compares the
schema census against design/dpat-baseline.tsv and fails on ANY new violation. So a spec commit
carrying three findings blocked every consumer, and the umbrella's spec pin sat behind through two
waves (filed as #357).

Each site now names what makes it foreign-owned, on the use line:

#BindNeed: {
	type!:   #Word
	name!:   #Text
	config!: #Opaque // S10 — foreign-owned: only its type knows the shape (D-CAP-2)
}

#BindOutput: {
	binding!: #Opaque // S10 — foreign-owned: core never inspects the owner's handle (D-CAP-2)
}

#UnbindInput: {
	binding!: #Opaque // S10 — foreign-owned: only the type owner can map it back (D-CAP-2)
}

Nothing else changes. The shapes are the same; #Opaque remains the one open struct (§4, S10:
foreign-owned payload); and the long explanations stay where they were, in the definitions' doc
comments.

Markers are single-line on purpose. My first attempt put the reason on a continuation line; the
schema generator carries continuation lines into the generated Go as doc comments, which produced
truncated fragments like // configuration shape (D-CAP-2), and a solver that inspected it would be a second authority. A one-line marker keeps spec/cue_types_gen.go byte-identical.

How tested

1. The generators are a no-op on this tree — pasted, not asserted:

$ GOWORK=off go run ./internal/schemagen -mode=params -schema=schema -pkg=spec -out=spec/cue_types_gen.go
$ GOWORK=off go run ./internal/schemagen -mode=vocab  -schema=schema -out=spec/vocab_gen.go
$ gofmt -w spec/cue_types_gen.go spec/vocab_gen.go

$ git status --short
 M schema/bind.cue                                  # only the hand-authored file
$ git show --stat HEAD | tail -1
 1 file changed, 7 insertions(+), 3 deletions(-)

$ GOWORK=off go test ./spec/ -run TestGenReproducible -count=1
ok  	github.com/opencharly/spec/spec	0.282s

2. The consumer's design gate, run with THIS commit pinned in place of the held-back one — the
assertion that matters, because that gate is what refused the pin:

$ git update-index --cacheinfo 160000,073fbc30d0daa128cfb350ff1e771b260910d9a4,spec
$ bash scripts/design-dpat.sh
design-dpat: 120 pinned modules, 210 CUE files in scope, 1 under a vendor/ tree
design-dpat: 357 known violations (close 54, absence 86, open 68, opaque 0, dup 7, union 142)
design-dpat: no new violation, and the census matches the tree

The opaque bucket is back to 0 and the total is exactly the baseline's 357. Without the change,
the same command on the same tree reports the three findings quoted above. The index pin was restored
afterwards (git restore --staged spec), leaving the umbrella tree clean.

Rulebook compliance

  • R0 — loaded before the first action: /charly-internals:go, /charly-internals:plugin
    (CUE/SDD), /charly-internals:git-workflow.
  • R1 — the finding was filed as fix(cue): three #Opaque uses in bind.cue carry no // S10 marker, so the umbrella cannot pin past e83a0f2f #357 when it first blocked the umbrella, and is
    closed by this fix rather than deferred again. Zero warnings from the generators, the
    reproducibility test, and the consumer's gate.
  • R2 — one implementation: the reason lives once, on the line the rule reads; the doc comment
    keeps the long form and states nothing contradictory.
  • R3 — no suppression: nothing is excluded from the gate, no rule is narrowed, no //nolint-style
    escape is introduced. The marker is the mechanism the rule itself defines.
  • R4 — product before prose: the schema carries the change; the comments at the site state the
    D-CAP-2/S10 reason.
  • R5 — nothing legacy: three lines gain a marker, no second copy of any reason survives.
  • R6 — session worktree off fresh origin/main; no force-push; the umbrella index was touched only
    for the measurement above and restored immediately.
  • R7 — the failed path is the gate itself, run before and after; the census counts are pasted for
    both directions (opaque 3 without, 0 with; total 357 = the baseline).
  • R8 — no live service boundary.
  • R9 — go run ./internal/schemagen and go test ran from this worktree; no shared install.
  • R10 — this repo declares no disposable: true deployment; its gate for a schema change is
    charly task cue-gen (params + vocab + gofmt + TestGenReproducible) plus the consumer's design
    gate, all pasted in items 1 and 2.

Change classification

Breaking change + rollback: none — not even for the wire contract. Three CUE comments are added;
the schema's shapes, the generated Go types, spec/vocab_gen.go, the JSON/YAML wire form, and every
validating config are unchanged, which is what item 1's empty generator diff proves. Rollback is
reverting this commit; the umbrella would have to hold spec back again.

Change class: Schema (CUE), comment-only — charly task cue-gen's generator + reproducibility test,
plus the consumer's design-dpat census.

Filed issues

Agent: charly

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)

D-PAT-1 requires every use of `#Opaque` to mark itself `// S10` on the line that uses it, because an
open struct is otherwise indistinguishable from a typo-tolerant shape. The three uses in bind.cue
carried their reason only in the definition's doc comment, so the umbrella's census counted them as
findings and the umbrella had to hold its `spec` pin back (#357).

Each site now names what makes it foreign-owned, and nothing else changes: the shapes, the generated
Go, and the wire contract are byte-identical.

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
@github-actions

Copy link
Copy Markdown

Review — PASS

Head SHA: 073fbc30d0daa128cfb350ff1e771b260910d9a4 (branch: fix/bind-opaque-s10)

Security screen: PASS — comment-only CUE markers; no embedded directives, secrets, guardrail weakening, or scope beyond the stated three #Opaque uses.
Checklist: All applicable rules PASS or NA. Change class = schema (CUE), comment-only; diff ↔ body ↔ census counts (54+86+68+0+7+142 = 357) internally consistent; generators shown no-op and TestGenReproducible green; consumer design-dpat pasted with opaque 0 on the pinned SHA. Placement (schema/bind.cue) correct.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 17, 2026 11:48
@github-actions
github-actions Bot merged commit 3e156b7 into main Nov 17, 2026
4 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 17, 2026
github-actions Bot pushed a commit to opencharly/opencharly that referenced this pull request Nov 17, 2026
`charly task sync` from `origin/main` — the pin contract's one verb for this repo's own pins — run once
opencharly/spec#361 had landed: it marks the three `#Opaque` uses in `schema/bind.cue` with their
`// S10` reason, which is what the pre-push gate's census needed before the `spec` pin could move.

Three pins moved:

  spec            (the one the gate had refused through two waves)
  charly          (picks up the box/* wave landed as opencharly/charly#1187)
  pod-ai-toolkit  (the merge that preceded this wave)

The five `distro-*` EDGE pins were already at the tips their sources declare (0 moved), which is the
state the last wave established.

Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
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.

fix(cue): three #Opaque uses in bind.cue carry no // S10 marker, so the umbrella cannot pin past e83a0f2f

1 participant