test(scale): each k8s e2e service app declares the nodes it writes, so the lane compiles again - #9016
Conversation
The fixture kept Products, Product, Cart and Order in shared/models.jac and imported all four into all three service apps, with a docstring saying the ownership was 'enforced by convention, not by code'. jaseci-labs#8920 made it code: E5108 refuses a node or edge that crosses an app boundary, so manifest generation stopped compiling products_app and both microservice e2e (k8s) lanes have been red since 2026-09-05. The over-import was defensive rather than functional. Each app referenced only the nodes it writes, and the extra names appeared on the import line and nowhere else. So each declaration moves into the app that owns it, and shared/models.jac keeps the pure helper the web app reaches, which is also what pins that a declared pip dep reaches the client build host.
A cross-app 'import from cart_app { view_cart }' compiles to a bridge stub
typed as a Coroutine, per reference/apps.md: cross-app calls are coroutines
and must be awaited. orders_app called view_cart() and clear_cart()
synchronously, so create_order failed to compile on
Type "Coroutine[<any>, <any>, dict]" has no attribute "get".
E5108 was masking this: the deploy refused the workspace before the type
error was reached, so fixing only the node ownership moved the lane from
one compile failure to another.
|
Correcting this PR's own claim, and pushing the fix for it. As it stood, this did not make the lane compile. It removed E5108 and exposed a second, unrelated compile failure that E5108 had been masking. Rig-validated against current main ( Main's fixture: This branch, before
stopping only at the Two things I want on the record rather than assumed. First, why PR CI cannot answer this. Second, what I have not proven: that the two lanes go green. I have proven the workspace compiles and plans, which is where both were dying. What remains untested is the runtime half, and specifically whether splitting the node declarations per app changes what each service sees under |
christianwilkins
left a comment
There was a problem hiding this comment.
Reviewed ac613ba5ff16946be29892bf4d58258f1b02b8a2, including the full diff, all three service consumers, the retained shared helper, and the nightly workflow. No blocking defect found in the declaration moves or the awaited bridge calls.
I verified that the complete Products, Product, Cart, and Order declaration blocks are byte-identical after moving into their owner files. qty_label and its humanize dependency remain in the shared module. The follow-up ac613ba5f correctly makes create_order async and awaits both cart calls. git diff --check passes.
My local compile validation is incomplete. A basic no-codegen probe passed on both old and new fixtures, so it does not protect the change. With force_target_program=True, the new fixture instead stops on E1053 at datetime.now(UTC) in orders_app; the old fixture stops earlier on different container-type diagnostics in cart_app. These are local compiler results, not a reproduction of the reported deployment failure, and I have not demonstrated that the datetime diagnostic is caused by this patch. All temporary fixture substitutions were restored.
Current-head PR CI is green and conflict-free, but the real microservice e2e (k8s, slim/official-image) jobs are in nightly.yml, not the PR workflow. I did not run a cluster. Status: runtime validation still needs the author's kind run or a maintainer dispatch against this head; ordinary PR checks do not establish that those lanes are fixed.
One nonblocking handoff cleanup: please update the PR description to include the async-call fix and the nightly-only validation limitation already explained in your follow-up comment. The current description still says those calls are synchronous and that the PR lanes are the run of record.
What this changes
microservice e2e (k8s, slim)and(k8s, official-image)have been red onmainsince 2026-09-05. Both fail before they reach a cluster:The fixture kept
Products,Product,CartandOrderinshared/models.jacand imported all four into all three service apps. Its own docstring said why, and named the thing that changed:#8920 made that convention code.
E5108refuses anodeoredgethat crosses an app boundary, because an app boundary is ACID within and eventual across, so a node class shared by four apps is exactly what the rule exists to stop.The over-import turned out to be defensive rather than functional. Grepping each app for the names it imports:
products_appcart_apporders_appweb(main.jac)Cartinorders_appis the string"Cart is empty"; every other extra name appears on the import line and nowhere else. So each declaration moves into the app that writes it, and the three cross-app imports go away rather than being narrowed.shared/models.jackeepsqty_labeland itsimport humanize, which is the reason that module is load-bearing for this fixture: it is the declared pip dep reached by the client entry, and it pins that a deploy hands the build host the app's[dependencies].Deleted
The four
nodedeclarations inshared/models.jac, and the threeimport from shared.models { ... }lines in the service apps. The stale docstring paragraph about a shared anchor store and convention-enforced ownership goes with them.What else this touches
Nothing outside
jac/jaclang/scale/tests/fixtures/k8s_e2e/. No product code, no test code, no config keys.main.jac'sqty_labelimport is unchanged, so the client-build dependency assertion the fixture exists for is unchanged.Validation
jac check --parse_only.microservice e2e (k8s, *)lanes, which stand up a kind cluster and a real deploy; those lanes on this PR are the run of record, and they are currently the failing ones onmain, so a green result here is the whole verification.orders_app.jacstill callsview_cart()andclear_cart()withoutawait, which Workspace apps: one repo, many targets, one type-checked codebase (#8823) #8920's bridge contract says should beE1042. That is either a second fixture defect or a gap in the rule, it is not what is failing the lane today, and it deserves its own change rather than being folded into a red-CI fix.