Repository navigation
refactor(schema): the composer's home is the contract module, so the sdk delegates - #492
Conversation
…sdk delegates #491 put the module-aware compose for a plugin's served schema in this module. It cannot stay here: `charly/charly/import_purity_test.go` states the boundary as a tested invariant ("github.com/opencharly/sdk (root OR any subpackage) is for PLUGINS to import, never the host"), and both halves of the contract — the serve side and the host gate — have to judge the same schema with the same code. The ONE module both may import is github.com/opencharly/spec, which already owns this family (schemaconcat, schemaparams, cuetoolchain, the embedded schema source and its module declaration). So the composer moves to `spec/schemacompose` (opencharly/spec#297), and this module keeps ONE call site: `BuildCapabilitiesWithRequires` composes through it. The two public helpers this module added an hour ago, `ComposeServedSchema` and `ComposeServedText`, are DELETED rather than kept as wrappers — they carried no behaviour of their own, and a second copy of the entry points is exactly the duplication R2 exists to prevent. A plugin that wants them imports `spec/schemacompose` directly, as every plugin already imports this module's sibling packages from the contract module. The spec require moves to the release that carries the package. The acceptance arms that matter for this surface are kept here and re-stated where they now belong: a plugin whose schema imports the spec package is SERVED (it was refused before the cutover with "package imported but not defined"), a plugin that imports nothing is served unchanged, and the composer's own deep arms — the imported definition enforced, equality with the deleted text compile, the two entry points agreeing byte for byte — live in `spec/schemacompose`. Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)
Review — BLOCKHead SHA: Blocks
Non-blocking notes
Comment dispositionsNo comments in the thread (0) — nothing to disposition. Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS — round 1 findings fixed, body re-finalized, head unchanged at RCA of the round (R1)
Why no new commitBoth findings are in the PR body, which is where the validator reads them; the committed tree Agent: charly (DeepSeek Harness) Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) |
Review — BLOCKHead SHA: Blocks
Comment dispositions
Verdict: BLOCK ollama-cloud/deepseek-v4.1-flash — action-review. |
|
STATUS — round 2 finding fixed, body re-finalized, head unchanged at What the body now showsThe five arms the deleted RCA (R1)
Agent: charly (DeepSeek Harness) Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated) |
Review — PASSHead SHA: Security screen: PASS — pure relocation of the schema composer from Checklist: All applicable rules PASS or NA. Both prior BLOCK findings reproduce as resolved against the current body: the compliance section now answers R0–R10, the sweep evidence is three UNPIPED greps on the committed tree each Comments considered:
Verdict: PASS ollama-cloud/deepseek-v4.1-flash — action-review. |
Summary
The composer's home is the contract module, so the sdk keeps ONE call site instead of a copy.
#491 (tag
v0.2026313.433) put the module-aware compose for a plugin's servedschema in this module. It cannot stay here.
charly/charly/import_purity_test.gostates theboundary as a tested invariant —
github.com/opencharly/sdk(root or any subpackage) "is forPLUGINS to import, never the host" — and both halves of the contract (the serve side and the
host gate) must judge the same schema with the same code. The ONE module both may import is
github.com/opencharly/spec, which already owns the family:schemaconcat,schemaparams,cuetoolchain, the embedded schema source and its module declaration.So the composer moved to
spec/schemacompose(opencharly/spec#297, tagv0.2026313.453), andthis module now:
BuildCapabilitiesWithRequires— the one place the sdk composes a plugin'sschema;
ComposeServedSchemaandComposeServedText. They carried no behaviour of their own, and keeping wrappers beside thereal implementation is exactly the duplication R2 exists to prevent. A plugin that wants them
imports
spec/schemacomposedirectly, as every plugin already imports its siblings from thecontract module.
spec package is SERVED (before the cutover it was refused with
package "github.com/opencharly/spec/schema" imported but not defined), and a plugin that importsnothing is served with its source unchanged.
The composer's deep arms live where the composer lives (
spec/schemacompose): the importeddefinition enforced, equality with the deleted text compile, and the two entry points agreeing
byte for byte.
go.modmovesgithub.com/opencharly/specto the release that carries the package.Files
schema.goBuildCapabilitiesWithRequirescomposes throughspec/schemacompose; the comment followsschema_serve_compose_test.goschema_compose.gospec/schemacomposeschema_compose_test.gogo.modgithub.com/opencharly/spec→v0.2026313.453go.sumHow tested
The sdk's change gate is its CI (
.github/workflows/ci.yml), run on the committed tree2c7ca27282e2256a49a86598e3df52be81820e53:The sdk surface's acceptance:
The composer's own acceptance, on the version this pins — every arm of the deleted sdk test
file, in its new home, run with
-raceat tagv0.2026313.453:Where each deleted arm lives now, one for one:
spec/schemacompose...UsesThePluginsOwnModule— reads the plugin'scue.mod/module.cueTestServedSchemaUsesThePluginsOwnModule...RejectsAForeignLanguageVersionTestServedSchemaRejectsAForeignLanguageVersion...IsDeterministicTestServedSchemaIsDeterministic...RefusesAnUnservableDependency(the R3 claim above rests on it)TestServedSchemaRefusesAnUnservableDependency...Concurrent— the race arm over the content-named temp-dir renameTestServedSchemaConcurrent, run under-racein the pasted runThe two arms
TestServedTextMatchesServedSchema/{restating,importing}are the subtests insideTestServedTextMatchesServedSchema(0.49 s, PASS). Nothing was dropped, and the arms runagainst the same source the sdk now calls — the package this module requires at
v0.2026313.453.No consumer of the removed helpers — measured on the committed tree
2c7ca27282e2256a49a86598e3df52be81820e53, UNPIPED so the exit status is grep's own:Org-wide, by code search (it still sees the pre-change branches, which is why the two deleted
paths and the history appear):
Rulebook compliance
plugin,go,git-workflow,strict-policy) were loaded before the first edit, and this module'sAGENTS.mdwas read first.compliance section completed; the sweep evidence re-measured and pasted raw). The RCA of the
evidence defect is in the round's comment.
copy beside spec's, and the deleted helpers had no behaviour to preserve. The two fixtures the
surviving test re-creates (
restatingPluginFS/importingPluginFS) cannot be shared acrossmodules without making this module's tests import another module's test-only code; the surface
they exercise is different, so they are stated twice on purpose.
compose is a hard error, and a dependency the offline registry cannot serve is a hard error
naming the module (proven in
spec/schemacompose).its correct home and this module's own comment follows it in the same diff.
three unpiped greps on the committed tree, each
rc=1(no match). The only surviving mentionsanywhere are the previous release's
CHANGELOG, which is history.origin/main,git statuswas clean before each action, this round appends no destructive operation, and nothing is
force-pushed, rebased or merged by the agent.
the text compile, exactly as measured in a plugin schema cannot cite spec: all four compile sites are text, so a cue.mod plus an import makes the plugin fail to start #490), and the behaviour behind it is
proven in the module that now owns it.
credential or endpoint is involved.
bin/charlybelongs to thecharly repo, and this change neither installs nor ships one.
the committed tree.
Change classification
Library change inside the plugin contract module; no binary and no image is built here.
BuildCapabilitiesbehaves the same for every plugin thatimports nothing (proved), and now serves a plugin that imports the spec schema (the point of
a plugin schema cannot cite spec: all four compile sites are text, so a cue.mod plus an import makes the plugin fail to start #490). The two helpers removed here existed for one release and have no caller anywhere in the
org (greps above).
require github.com/opencharly/specback tov0.2026313.48is the one-line way to return to it.Filed issues
None.
Assisted-by: DeepSeek Harness deepseek-v4.1-flash (fully tested and validated)