Skip to content

fix(cue): give each #MountNeed boolean its own union line (D-PAT-3) - #365

Merged
github-actions[bot] merged 1 commit into
mainfrom
fix/mountneed-one-union-per-line
Nov 17, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
fix/mountneed-one-union-per-line

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

D-PAT-3 judges a line: a | disjunction outside or(...) is a violation unless the line carries
exactly ONE, as a literal default — scripts/design-dpat.sh:

if (nbar == 1 && literal_default(barpos[1])) nbar = 0
if (nbar > 0) emit("union", ...)

#MountNeed packed two of them onto one line:

#MountNeed:    {host!: #AbsPath, path!: #AbsPath, writable: *false | bool, exclusive: *false | bool}

so the census counted a union finding at schema/capability.cue:209, and opencharly/opencharly could
not pin the commit that carried it — the same block that held spec back through three waves, one
layer down. Filed as #364.

The shape is unchanged; the fields are written one per line, which is how its two siblings already
read:

#CountNeed:    {count!: #Count, exclusive: *false | bool}
#SizeNeed:     {size!: #Size, exclusive: *false | bool}
#MountNeed: {
	host!:      #AbsPath
	path!:      #AbsPath
	writable:   *false | bool
	exclusive:  *false | bool
}

*false | bool is the pre-existing spelling on every boolean field in this schema (17 sites across
capability.cue and docs.cue) and is deliberately not part of this change: it keeps validating as
before, and one literal default per line is exactly what the rule asks for.

How tested

1. The generators are a no-op — 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/capability.cue                            # only the hand-authored file

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

2. The consumer's design gate, with THIS commit pinned — the assertion that matters:

$ git update-index --cacheinfo 160000,b170f2712ee61ebfd600c7b1b0845abfbe919d07,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

Without the change, the same command on the same tree reports:

FAIL spec/schema/capability.cue:209: union: a union written out alternative by alternative — derive
     it from one tag table (S4) or one vocabulary table (S3); only a two-value literal default is
     written inline (D-PAT-3)

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 is a fresh R1 anomaly surfaced by the umbrella's wave; it is a real defect in
    this schema and is filed (fix(cue): #MountNeed carries two unions on one line, so the umbrella cannot pin it (D-PAT-3) #364) and fixed here in the same breath rather than left
    for the next wave. Zero warnings from the generators, the reproducibility test and the consumer's
    gate.
  • R2 — one implementation: no new vocabulary table is introduced for a boolean, because booleans
    are CUE's own two-value set; the fix is layout, not a second source of truth for true/false.
  • R3 — no suppression: no exclusion from the gate, no narrowing of the rule, no // S10-style
    marker used to silence a rule that is about shape rather than ownership.
  • R4 — product before prose: the schema carries the change; the comment above the three shapes
    still explains the lease-field port.
  • R5 — nothing legacy: the one-line definition is replaced, not kept beside a second copy.
  • R6 — session worktree off fresh origin/main; no force-push; the umbrella index was touched
    only for the measurement and restored immediately.
  • R7 — the failing path is the gate itself, measured in both directions (finding present at
    723d29b, absent at this commit; census 357 with the same 142 unions in both).
  • 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; a schema change's gate here is
    charly task cue-gen (params + vocab + gofmt + TestGenReproducible) plus the consumer's design
    gate, both pasted.

Change classification

Breaking change + rollback: none — the definition's shape and its fields' types are identical, so
every validating config validates as before and the generated Go is byte-identical (item 1). Rollback
is reverting this commit; the union finding returns and the umbrella has to hold spec at
115d5d3b97a0 again.

Change class: Schema (CUE), layout-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-3 judges a line: a `|` disjunction outside `or(...)` is a violation unless the line carries
exactly ONE, as a literal default (`design-dpat.sh`: `if (nbar == 1 && literal_default(...))`).
`#MountNeed` packed two of them onto one line:

```cue
#MountNeed:    {host!: #AbsPath, path!: #AbsPath, writable: *false | bool, exclusive: *false | bool}
```

so the census counted a union finding there, and opencharly/opencharly could not pin the commit that
carried it — the same block that held `spec` back through three waves, one layer down.

The shape is unchanged; the fields are simply written one per line, which is how its two siblings
`#CountNeed` and `#SizeNeed` already read:

```cue
#MountNeed: {
	host!:      #AbsPath
	path!:      #AbsPath
	writable:   *false | bool
	exclusive:  *false | bool
}
```

`*false | bool` is the pre-existing spelling on every such field in this schema and is not part of
this change: it keeps validating as before, and the census sees one literal default per line.

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

Copy link
Copy Markdown

Review — PASS

Head SHA: b170f2712ee61ebfd600c7b1b0845abfbe919d07 (branch: fix/mountneed-one-union-per-line)

Security screen: PASS — layout-only CUE change; no secrets, no guardrail weakening, no supply-chain/instruction-injection content.
Checklist: All applicable rules PASS or NA (schema/CUE layout class).
Comment thread: empty — nothing to disposition.

Tool-limited note: cannot re-run design-dpat.sh / generators; the pasted evidence is internally consistent (one-union-per-line matches the nbar == 1 && literal_default branch; git status --short showing only schema/capability.cue matches a byte-identical generator no-op; TestGenReproducible passing corroborates it; "same 142 unions in both" reconciles as the constant baseline line with only the new-violation verdict differing).

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 12:42
@github-actions
github-actions Bot merged commit 6c4dc29 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`, run once the three producer legs had landed:

- opencharly/spec#365 — `#MountNeed` gives each boolean its own union line, so the D-PAT-3 census
  stops counting a finding there (opencharly/spec#364);
- opencharly/charly#1189 — `box/cachyos` advanced to the tip distro-cachyos serves, which the
  umbrella's `distro-cachyos` EDGE pin follows.

Seven pins moved:

  charly, sdk, spec                    (leaf pins)
  distro-cachyos                       (EDGE — unblocked by box/cachyos)
  charly-ubuntu, layer-tailscale,
  pod-comfyui

Control after the wave, which is what this change exists to satisfy:

  currency: 0 of 394 pin(s) NOT current [394 cur]

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): #MountNeed carries two unions on one line, so the umbrella cannot pin it (D-PAT-3)

1 participant