Repository navigation
fix(objectql): a connector a composed stack declares only on its top level, beside package bodies, lends its credential at boot - #28046
Conversation
…ends at boot The manifest service registered a multi-package stack's residual objects under the stack's manifest id, but not its connectors. The credential lender and the connector reconcile read connectors from the ObjectQL registry only, so a connector instance declared only on the top level of a mixed composed input was refused as undeclared at boot, although the composed check accepts a borrow of it. The residual's connectors now register the way its objects do: after every body, under the residual rule's id, on a stamped copy. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2dhraZ7BwSanQPGEAb
…connector borrow test Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ihL2dhraZ7BwSanQPGEAb
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 20 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a8100ebf01249baf8a076240010851ee9f3c09d2 && git checkout a8100ebf01249baf8a076240010851ee9f3c09d2
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5aee206543c87fab6c555d5fdfc19b9d29c428b2 a5d4ed3fcdf081d0cdc30ab3e0a3543c26a733e3 && git checkout -B drift-repro 5aee206543c87fab6c555d5fdfc19b9d29c428b2 && git merge --no-ff a5d4ed3fcdf081d0cdc30ab3e0a3543c26a733e3
node scripts/docs-audit/affected-docs.mjs --json 5aee206543c87fab6c555d5fdfc19b9d29c428b2
|
|
epic:#27261#1 · marchtian · session_017ihL2c5z3q4h8inrn5kwqV 维护者速读
席位意见:ACCEPT。不碰契约四面: 席位核对
|
Requested by 田騏 · project thread
Fixes #28032
Clause-②: no
Metadata-protocol: none
维护者速读
packages[]包体、又只在顶层声明了一个连接器实例(没有包体声明同名)时,ObjectQL 的manifest服务现在会把这个"残留"连接器注册进 ObjectQL 注册表,归属栈自己的manifest.id,和残留对象(ADR-0130 D4)已有的做法一样。composeStacks(…, { manifest: 'preserve' })接受这个借用,开机时数据源借用却被拒,报"is not declared in this stack's connectors"。修复后开机即可借到。What changes
packages/objectql/src/plugin.ts. A newunclaimedTopLevelConnectors(stack)reads the residual rule's own answer (unclaimedTopLevel,@objectstack/metadata) forconnectoritems, asunclaimedTopLevelObjectsdoes for objects. Themanifestservice registers them after every body and after the residual objects, under the residual rule's id, throughregistry.registerItem('connector', …), the verb a body's connectors take. Each is stamped with the stack's version on a shallow copy, so the artifact's own entry is left as it arrived (the residual-object precedent). The "emptypackages: []" warning no longer fires for a stack whose only residual is a connector.packages/services/service-automation/src/connector-credential-residual-connector.test.ts(new). A real kernel (ObjectKernel, ObjectQLPlugin over SQLite, AutomationServicePlugin) bootscomposeStacks([mixed(instance), looseBorrower], { manifest: 'preserve' })through themanifestservice and borrows throughCONNECTOR_CREDENTIAL_SOURCE_SERVICE. Pins: the composed check accepts the shape; the residual instance lends at boot and is owned by the stack's id; a residual descriptor (noprovider) is refused at boot as a descriptor (declares no provider), not as undeclared; CONTROL: an instance a package body declares lends, owned by the body.packages/objectql/src/manifest-service-residual-objects.test.ts. Three engine-half pins: a residual connector registers under the stack's id and version beside a body's own; it registers when the stack has no residual object; CONTROL: a top-level connector a body repeats is the body's, registered once..changeset/28032-residual-connector-lends-at-boot.md.@objectstack/objectqlpatch.Why
The measurement (before the fix, at
origin/main13d85bb)The new service-automation test, run against the unfixed
@objectstack/objectqlbuild:registry.listItems('connector')was[]after boot, for the residual instance and the residual descriptor alike.source.borrow('sap_s4')was refused: "connector instance 'sap_s4' (named by this datasource's external.connector) is not declared in this stack's connectors."So the card's premise held: the build accepts a borrow the boot refuses. The reload half ("lends after a reload") was read off
captureReloadedConnectors, not measured.Why option (a)
Option (a) makes the boot agree with what the composed check already accepts, and changes nothing an author can write. The residual rule already decides which items are residual and under which id, and the engine already registers that answer's objects; connectors are the second type a boot-time reader takes from the registry alone. Option (b) (refuse the borrow in
stack.zod.ts) would narrow the accept set and was not claimed.Verification
connector-credential-residual-connector.test.ts: red before the fix (2 of 4: both residual cases), green after (4 of 4), against a rebuilt@objectstack/objectql.manifest-service-residual-objects.test.ts: 12 passed. Reverse check from the committed fix: restoringplugin.tsfrom the parent commit fails exactly the two residual-connector pins; the CONTROL stays green.pnpm --filter @objectstack/objectql typecheckandpnpm --filter @objectstack/service-automation typecheck: exit 0. Full suites:@objectstack/objectql493 files, 9595 passed;@objectstack/service-automation224 files, 2845 passed (1 expected fail).dispatch-gates --commandsderived 63 families; all run with exit codes recorded (after building./packages/**). One red on the first pass:check:slot-lookup(an untypedgetService<any>('automation')in the new test), fixed in3ab79536.--ran: 63 derived, 63 run, 0 NOT-MEASURED (a derived zero).origin/mainmerged ata5d4ed3f(5 commits;cc5586datouched the lender'splugin.ts); the derived list is unchanged after the merge, and the borrow and lender tests re-run green on the merge (21 passed).Acceptance notes
manifestservice still registers only the residual's objects and, now, connectors. Other registry-read collections a residual can carry (flows, permissions and the rest ofMETADATA_ARRAY_KEYS) are still metadata-service only. Not measured and not widened here; named in the os-dev-report for the PM.manifestservice. The artifact door hands the engine the same stack through the same service, so the fix covers both; the artifact door was not booted separately.Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintis CI's).main, one pull request.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_017ihL2dhraZ7BwSanQPGEAb