Fix Studio query contracts for authored workspaces
Keep query definition identity scoped to interfaces present in the generated query schema. Exclude retention provenance from both interface revisions and generic applications while preserving nominal identities, closed arguments, operation contracts, documents, budgets and fragment dependencies. Advance the query semantics version so prior compiler outputs cannot share the new identity. Add a generic compiler regression covering unrelated imports, retained generic sources and invalidation when an observed getter changes. This fixes Studio's CLIENT_QUERY_MISMATCH when template contracts become editable local repositories. Validation: protocol tests (296 total, 293 passed, 3 existing skips); nix fmt, monorepo lint, final formatting check and diff check; camino-dev/qx-workspace builds. All 17 Studio query descriptors match a rebuilt copy of the user's workspace. Headless fresh-workspace canvas/library/Reader/reload check passes. Repair the existing local qx-reader workbench through its ordinary check and activation path, updating only its pinned protocol/checker CLI. Retain the original toolchain GC root and record checker provenance. Source commit, runtime and template pins, and database are preserved. Verify the selected candidate is ready at epoch 2 and its canvas loads through the corrected Studio bundle without creating application objects. Stop the independent smoke-test services.
This commit is contained in:
+15
-4
@@ -634,15 +634,26 @@ export async function compileQuery(
|
||||
const definitionDigest = createHash("sha256")
|
||||
.update(
|
||||
canonicalJson({
|
||||
semantics: 5,
|
||||
semantics: 6,
|
||||
declaration,
|
||||
normalized,
|
||||
fragmentContracts: Object.fromEntries(fragmentContracts),
|
||||
// Source provenance belongs to the checked installation. Identical public
|
||||
// contracts keep their query identity when retained in another repository.
|
||||
// Closed generic identity remains explicit in revisionId/application.
|
||||
interfaces: [...generated.byName.values()]
|
||||
.map(({ source: _source, ...contract }) => contract)
|
||||
// Closed generic identity remains explicit in revisionId/application;
|
||||
// its template's retention source is provenance too. byName also holds
|
||||
// names probed while discovering nominal projections, so only include
|
||||
// interfaces actually present in the generated query schema.
|
||||
interfaces: Object.values(generated.schema.getTypeMap())
|
||||
.filter(isObjectType)
|
||||
.flatMap((type) => {
|
||||
const revision = generated.byName.get(type.name);
|
||||
if (!revision) return [];
|
||||
const { source: _source, application, ...contract } = revision;
|
||||
if (!application) return [contract];
|
||||
const { source: _templateSource, ...identity } = application;
|
||||
return [{ ...contract, application: identity }];
|
||||
})
|
||||
.sort((a, b) => (a.revisionId < b.revisionId ? -1 : a.revisionId > b.revisionId ? 1 : 0)),
|
||||
}),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user