Skip to content

docs(go): the source map calls spec/schema/*.cue package-less — they are now one package schema in a module #1112

Closed

Description

@aitrawog

The finding

charly/.agents/skills/go/references/source-map.md:79 (rendered into the marketplace corpus at
docs/marketplace/internals/skills/go/references/source-map.md:81) says:

The ONE ConcatSchema both the RUNTIME (charly/cue_schema.go's sharedCueSchema, over the
spec/schema embed FS) and the dev-time generator call to fold every package-less
schema/*.cue file into one compilation unit, so the schema the runtime validates against and
the Go types gengotypes produces can never drift.

opencharly/spec#295 makes that input description false: spec/schema/*.cue is now ONE CUE package
(package schema) in the module github.com/opencharly/spec (cue.mod/module.cue), and
ConcatSchema STRIPS each file's leading clause so the joined body stays the package-less
compilation unit every consumer compiles. The sentence stays true about the concatenation's
OUTPUT and is now wrong about its INPUT files.

RCA

  • Mechanism: the package form landed in spec (TODO.md 2.5, the first unit of the
    concat → package cutover) and the prose that described the old input shape was not updated in
    the repo that authors the go skill.
  • Missed control: none in charly — the skill prose and spec/schema/*.cue live in different
    repos with different lifecycles, so no gate in either repo compares them; the marketplace
    corpus is generated from charly/.agents/, so the rendered copy is correct and the SOURCE is
    the file to fix.
  • Blast radius: documentation only. A reader of the go skill who inspects
    spec/schema/*.cue finds a package clause the sentence says cannot exist; the concatenation
    contract itself (and ConcatSchema's behavior) is unchanged.
  • Root fix: reword the sentence to match the shipped mechanism — every schema/*.cue file
    carries package schema, and ConcatSchema strips it before folding the files into one
    compilation unit — then regenerate the marketplace projection.

Evidence

At opencharly/spec feat/cue-module (head of #295), from the spec worktree root:

$ head -3 schema/agent.cue
package schema

// CUE schema for the `agent` kind. #Agent validates ONE value of the `agent:`
$ grep -l "^package schema$" schema/*.cue | wc -l
64
$ ls cue.mod/module.cue
cue.mod/module.cue
$ grep -n "module:" cue.mod/module.cue
11:module: "github.com/opencharly/spec"

and the concatenator now normalizes the clause (schemaconcat.ConcatSchema), with
schema/package_matches_concat_test.go gating the two forms against each other.

The sibling claim in charly/.agents/skills/plugin/references/cue-schema-contract.md:12 is NOT
affected: plugin schemas remain package-less, self-contained text served over the protocol.

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions