THOTH-GQL-DATALOADER-01: add request-scoped GraphQL DataLoader foundation - #802
Draft
ja573 wants to merge 21 commits into
Draft
THOTH-GQL-DATALOADER-01: add request-scoped GraphQL DataLoader foundation#802ja573 wants to merge 21 commits into
ja573 wants to merge 21 commits into
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.
STATUS: BLOCKED / IMPLEMENTATION INCOMPLETE — DO NOT REVIEW AS A COMPLETED IMPLEMENTATION
Task identity
THOTH-GQL-DATALOADER-01developat060052b47490d3d977db3b9d9f188c4c70760a9afeature/shared-architecture/graphql-dataloader-foundation56f5027431b7456a0fedbfa8d71314e809eb0a7bdocs/engineering/ai-delivery/tasks/THOTH-GQL-DATALOADER-01.mdADR-0007This PR is the one bounded implementation authorized by the CTO. It remains DRAFT, adopts no production GraphQL field, and carries no merge, deployment, release, production-access or activation authorization.
Completed on this branch
dataloader 0.18.xdependency configuration with defaults disabled and Tokio runtime support; CI resolves exactlydataloader 0.18.0.rtsupport for productionspawn_blocking; test runtime features remain dev-only.200/ yield-count10construction andtry_load-oriented test consumers.tokio::task::spawn_blocking:Arc<PgPool>and immutable keys enter the closure, connection acquisition and all Diesel work occur inside it, and the batch is set-based witheq_any.[200, 50]/ two set-based imprint statements.MutationGuardMode::store_available()and its guard-as-store-switch API/documentation; preserved the independent guard and its default/activation state.Contextindependently of mutation guard mode after the request-boundary guard decision.Temporary compatibility bridge — MUST NOT SURVIVE REVIEW
thoth-api/src/graphql/batching.rscurrently contains only a temporary source-level type alias from the legacyGraphqlBatchStorename to the newRequestLoadersbundle. The old A2 stored-result/store/scope/failure machinery is gone, and the temporary constructor ignores guard mode, butContextstill exposes the legacybatch_storefield andwith_guard_modeconstructor because this execution environment cannot safely patch the large existingmodel.rsfile.This is not specification-compliant final state. The PR must not be presented for independent review until the alias, legacy field and legacy constructor are removed and
Contextdirectly ownsRequestLoaders.Missing required work
The following is missing work, not waived acceptance evidence:
thoth-api/src/graphql/model.rs: remove A2 imports, rename/removebatch_store, add directRequestLoadersownership, deleteContext::with_guard_mode, and then delete the temporarybatching.rsalias/module.test_context_with_guard_modeand ADR-0006 invariant-30 comment inthoth-api/src/model/tests.rsafter the Context migration.thoth-api/src/graphql/tests.rs: replace the central/generalexecute_syncpath with the approved async bridge and add explicit nested-runtime misuse evidence. The new dedicated DataLoader and rehosted guard suites are async, but this repository-wide test seam is still outstanding.Cargo.lockwith the resolveddataloader 0.18.0package/dependency entry. CI has independently demonstrated the resolution, but the lockfile is not yet committed.cargo fmt --all -- --checkis currently red on newly added test files; exact rustfmt diffs are available in CI and must be applied rather than suppressed.test_context_with_guard_modehelper as dead code; that helper must be removed, not allow-listed.check-changelogis currently red for this missing control record; nono-changelogbypass is acceptable.Current CI evidence at head
56f5027431b7456a0fedbfa8d71314e809eb0a7bdataloader v0.18.0and the new loader code.lint: FAIL only on dead-codetest_context_with_guard_modeinthoth-api/src/model/tests.rs; this is expected missing A2-retirement cleanup and must be removed.format_check: FAIL with rustfmt-only diffs in newly added DataLoader/guard test files.check-changelog: FAIL because the implementation entry is not yet present.test/build/ migration/publish-classification runs must be reported from their final completed state; no result is inferred while a job is still running.Execution-environment blocker
The connected GitHub app exposes whole-file replacement for existing files, but no line/patch write primitive. This runtime also has no network-capable local checkout, no installed Rust/rustfmt toolchain and no installed
agent-browserCLI. Whole-file replacement is safe for the new/small files already changed, but using it to manually reconstruct the multi-thousand-line authoritativemodel.rs,graphql/tests.rs,Cargo.lockorCHANGELOG.mdwould create an unacceptable accidental-diff risk on a HIGH-risk shared backend task.No architectural relaxation is being made to work around that tooling limitation. Missing evidence remains missing work.
Authorization boundaries — unchanged
NOT authorized by this PR: merge, deployment, release, production access, workflow dispatch,
BE-02, Thoth Metrics adoption,OBSERVE,ENFORCE, PR #799 remediation/merge/closure, or architecture changes outside ADR-0007.PR #799 remains outside this task and untouched.
Next gate
No independent implementation review yet. A capable implementation environment with a normal patchable checkout must continue this same bounded branch/PR, complete the missing items above, obtain green final exact-head CI/evidence, and only then present PR #802 for fresh independent exact-head review. The implementing agent must not approve its own work. Separate explicit CTO merge authorization remains required after independent approval.