Resolve #2279: harden DI request scope lifecycle and introspection ownership#2302
Open
ayden94 wants to merge 4 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Harden
@fluojs/direquest-scope lifecycle ownership and framework introspection boundaries.Linked context: Closes #2279
Changes
inspectResolutionState()map exposure with read-only map views, frozen normalized provider records, and controlled cache adoption for framework tooling.@fluojs/testingsync cache adoption off directMapmutation and onto the new container-owned cache adoption seam.@fluojs/testingfirst materializes a sync factory throughget(), so later async sync-points can safely promote dependent sync graphs.provide: null, and zero-strategy provider validation.get(A)materializes a sync factory,resolve(B)follows whereBdepends onA, thenget(B)preserves identity instead of throwing a false async-only error.packages/diEN/KO README lifecycle and introspection contract text..changeset/soft-pandas-guard.mdfor@fluojs/dimajor release impact and@fluojs/testingpatch release impact.Testing
lsp_diagnosticsattempted for changed TS files; unavailable in this environment becausebiomeexecutable was not found by the LSP tool.pnpm install --frozen-lockfilepnpm --dir packages/di typecheckpnpm --dir packages/di testpnpm --dir packages/di buildpnpm --dir packages/testing typecheckpnpm --dir packages/testing testpnpm exec biome lint packages/di/src/container.ts packages/testing/src/module.ts packages/testing/src/module.test.tspnpm buildpnpm verify:release-readinessRelease impact
Changeset:
.changeset/soft-pandas-guard.mdrecords@fluojs/diasmajorand@fluojs/testingaspatch.Migration note: callers that used
inspectResolutionState()as a mutable escape hatch must stop mutating returned registration/cache maps or normalized provider records. Framework-owned tooling should use the returnedcacheOwnerhelpers for controlled cache adoption instead of writing to the maps directly. Ordinary application code should continue usinghas(...),resolve(...), and documented container APIs instead of the introspection seam.Public export documentation
See docs/contracts/public-export-tsdoc-baseline.md for the repo-wide authoring baseline.
@param/@returnstags where applicable.@exampleblocks and README scenario examples still play complementary roles.Behavioral contract
See docs/contracts/behavioral-contract-policy.md for full details.
Platform consistency governance (SSOT)
See docs/architecture/platform-consistency-design.md and docs/contracts/release-governance.md.
createPlatformConformanceHarness(...)tests. (N/A: no platform conformance claim changed.)