Teacher-invoked Platform Bridge Pull
Implementation design for build-plan D3 and proposed ADR-0067, 2026-10-03. These are coordinator implementation choices, not new maintainer policy. D3a covers Xuexitong assignment and iTest assessed results; D3b implements Survey answers, their separate session host and anonymity contract.
Canonical records
Section titled “Canonical records”Aggregate external marks land in the existing Gradebook Entry, which already supports results without an Attempt. A native Score remains the graded outcome of an Attempt. External Item Result names the attempt-less item mark observed on a mandated platform: its source identity, awarded/maximum marks and optional authored Item-Version mapping. It belongs to a stable External Assessment Result, attributed to a Person and assessment counterpart. No native Attempt or Item Session is fabricated, and item evidence is not hidden in Gradebook metadata.
Only necessary normalized marks, statuses, source identities and timestamps persist. Learner answers, answer keys, names, IPs, marker names and arbitrary provider payloads are discarded. Detailed evidence is server-only and person-linked for erasure; canonical aggregate grades keep their existing erasure posture. This does not yet implement competency attainment or psychometrics.
A typed readonly Gradebook origin distinguishes native, OneRoster, Observation and Platform Bridge cells. Attempt-less cells offer no native Attempt review/grading action. Existing OneRoster markers support a conservative legacy backfill; old native writes sometimes preserved stale metadata, so that backfill cannot prove every historical origin. The label is not an authorization decision. Future writers explicitly stamp origin and clear stale provenance. Bridge-owned cells cannot be silently overwritten by another writer, and Pull cannot take over a native/manual/Observation/other-source cell.
Attaching a counterpart disables native delivery of that Assessment Definition without changing its authored version or content. The server-owned flag is absent from client projections; learners stop receiving its assessment card, while teachers retain the editable definition. Attachment refuses a target with any non-erased native Attempt. Native start and attachment lock the same parent definition before their writes, and both native start rails refuse disabled targets before creating an Attempt. Database protection also prevents direct client starts and flag changes. Explicitly retargeting an unused counterpart restores its old definition’s native delivery and disables its new target atomically. Teacher Operations Tasks remain valid: they contain no learner assessment-start actions.
Authored context and stable identity
Section titled “Authored context and stable identity”An Offering binding names the approved deployment, exact external class/context, roster issuer, historical attribution instant and declared source period/year. It is authored context, not proof of external account identity. A counterpart binds the exact external assessed object and source maximum to one existing Assessment Definition/version. Source and canonical maxima must agree; there is no automatic scaling. Item-Version mappings are explicit and restricted to the captured definition’s actual references, including older referenced versions.
The stable source namespace uses deployment, external context/class and assessed object, with the declared year where needed. It does not use a Connection row or teacher ID: reconnecting or using a second teacher’s Connection must not create another grade column/result. Natural uniqueness and counterpart version checks prevent ambiguous competing mappings. A changed context cannot silently retarget landed results.
Student numbers are exact institutional strings, including leading zeros. Attribution requires the configured issuer, effective identity binding and the Offering’s learner history at the validated source submission instant; when that instant is unavailable, it uses the authored attribution instant. The source instant must fall inside the authored source period. Names, email and ordering are never identity evidence; Pull never creates Persons. Unmatched, ambiguous, wrong-audience and conflicting rows are held and reported in bounded transient issue DTOs. Their raw identifiers/answers are not retained in a persistent hold queue. After fixing the underlying context, the teacher explicitly repeats Pull.
OneRoster sourcedId is an opaque external subject, not the student number. The current roster assertion comes from the latest successfully completed User snapshot per issuer/source and subject, selected before filtering its exact identifier. Tombstones, missing identifiers and conflicting assertions are held. That subject then resolves through the effective issuer-scoped identity binding and learner membership. Import time does not prove when an identifier became effective: D3a uses the current issuer assertion together with dated binding/membership history and does not claim historical identifier reconstruction.
Operation lifecycle
Section titled “Operation lifecycle”Metadata, binding, counterpart attachment, exact Item-Version reads, authored mapping replacement and Pull use the Operations catalogue. Every path checks active Person and live Offering reach, including the existing explicit-teacher rule for private Offerings. Session-consuming paths also require the actor’s own Connection. Issuer choices and matches are restricted to the Offering audience rather than arbitrary global identity searches. Audits omit identity and evidence payloads.
Pull commits a short session/version reservation, then reads the platform outside a database transaction. Each invocation freshly proves teacher access to the exact class/object through supported marking/listing contracts. This is readable-target evidence, not a verified self-account identity. Replaced sessions cannot inherit a previous target authorization conclusion. Remote execution is bounded to 90 seconds within the existing 120-second lease; Connection probes retain their 30-second bound.
Only a validated complete snapshot may reconcile. Finalization rechecks live reach, owner/session generation, binding/counterpart/definition/mapping versions and exact source target. It locks and advances the counterpart version so concurrent teachers cannot land two snapshots reserved against the same version in reverse completion order. Canonical grades and item evidence reconcile atomically with the success audit; late revoke, erasure or context edits refuse persistence.
The same normalized source content is a no-op for result/grade timestamps. Corrections update existing source-owned records. Explicit zero is a grade; missing, unsubmitted and ungraded are separate states. Missing rows do not retract grades. Existing numeric(12,4) precision governs canonical storage; normalized source hashes exclude retrieval time and request ordering. Refusals use closed reason keys and never provider bodies, URLs, identifiers or keys.
Historical item rows may survive source structure changes or an explicit ungraded correction. Active item evidence requires a currently graded parent and the counterpart’s current source structure fingerprint. Downstream attainment must use that boundary rather than counting every stored historical row.
Source controls and remaining work
Section titled “Source controls and remaining work”Xuexitong assignment IDs distinguish library template, released copy, activity and submitted answer. Marking starts with class0, then verifies actual hidden class/work IDs. Both submitted/unsubmitted listings require complete stable pagination and unique identities; malformed review blocks refuse rather than disappear. Yearless submission times use the declared period/year without a current-year heuristic.
iTest requires a fresh exact class-test/paper/class listing, stable complete result pages and actual scored-paper totals. Unfinished rows acquire no score from the teacher-only grid field. Item identity is the structure-bound paper/table/label/number tuple; it is never guessed as a native Item ID. Both readers validate item maxima/sums and source structure, and recheck the exact object after collection. Undocumented platforms provide no transactionally frozen snapshot guarantee.
Survey uses mobilelearn.chaoxing.com; the existing mooc2-ans host-only paste cannot authorize it. D3b prepares/probes that host explicitly and preserves the primary jar on failure. The inspected Survey source lacks an opaque submission ID and groups by student number, so anonymous replay uses the separate privacy design below; a hidden Person receipt or student-number-derived durable key is not acceptable.
The bounded D3b implementation imports operational teaching feedback, with researchExcluded=true until an actual research use-gate exists. It does not treat participation consent as research consent or import purely speculative research data. Explicit question mappings support only the verified free-text source contract initially. The source exposes current answers per question, so import means a current answer-vector snapshot, not a reconstructed submission history. Duplicate student/question occurrences, count disagreement, missing required answers and unsupported question semantics refuse conversion. Different question answer times are ordinary input and do not establish separate submissions.
Survey targets remain institutional, matching the existing native Survey authority floor. Target signatures capture exact scope, anonymity, question prompts and response semantics, and derived item identity/code/type/required rules. Top-level display titles, availability windows and open/closed status do not invalidate a signature. Attachment freezes native response semantics, the derived question index and anonymity. Before any accepted snapshot, an explicit refresh or retarget may replace the unused target and invalidate old mapping/probe proof; every accepted snapshot, including explicit zero, prevents retargeting and binding-context correction. Native Questionnaire updates/deletes are currently refused by the application; direct client and future writers still need this protection.
Attachment locks the Survey and Questionnaire parents without locking or writing referenced question rows. Native question-index mutations first reject an attached target through a nonlocking private lookup. For an unattached target they take the Questionnaire SHARE lock with NOWAIT and recheck attachment before proceeding; contention returns a fixed retry refusal rather than waiting while holding a child row. This serializes pending index edits with first attachment without a parent/child lock cycle. Client question reparenting is unsupported and refused. Imports use the same parent order, recheck the exact target and mapping, and rely on the attached-target guard rather than introducing an opposite child-lock order.
Whole-vector attribution uses the binding’s authored attribution instant; individual source answer times only validate the declared period. Unresolved, ambiguous or wrong-audience identity refuses the whole Survey snapshot and preserves prior responses, rather than treating missing matches as an empty cohort. Known explicit participation exclusions may produce a complete empty replacement. Excluded answer content is neither persisted nor hashed. Source-anonymous answers cannot enter an identified native target; an anonymous target may discard an identified source’s linkage after transient attribution/exclusion.
For an anonymous target, attribution/exclusion happens transiently before discarding identifiers, source ordering and exact source answer times. A canonical multiset fingerprint contains only eligible normalized answers, provenance/research-exclusion flags, safe aggregate exclusion counts and target/mapping signatures. Equal complete snapshots are a no-op; corrections replace only the Bridge-owned anonymous response graph atomically, with random opaque response keys and a shared import-observed timestamp. No respondent receipt is retained. Identified targets may use per-Person ownership with normal erasure, while keeping native and other counterparts’ responses intact.
Imported responses carry immutable server-only origin provenance. Native learner writes cannot modify a Bridge-owned response graph. Both Survey telemetry readers exclude imports from the first import: the current event model cannot retract a replaced anonymous cohort, and the source does not prove native Started/Submitted times. Native learner telemetry remains unchanged. This choice preserves operational summaries without fabricating lifecycle events. Every collection requires two matching complete reads; zero-response replacement needs explicit complete evidence.
The implementation uses three private RLS tables for the counterpart, observed/authored question maps and random canonical-response ownership. Anonymous ownership has no Person, source respondent ID, source order, per-response hash or individual source time. Identified ownership supports stable corrections and erasure. Identified comparison also checks each Person’s answers, so exchanging answers between two learners is a change even when the multiset is equal.
Preparation can verify an unstarted external Survey; answer Pull accepts running/ended activities only. Attachment validates the provider’s positive numeric IDs before freezing the native target. An unchanged attachment save preserves proof/maps/version. Before any accepted snapshot, a deliberate activity-ID correction on the same binding or native retarget clears obsolete proof/maps under the old counterpart version; this permits recovery from a wrong copied ID. Binding identity/source scope remain fixed, and every accepted snapshot including zero fixes activity identity too. Duplicate-source conflicts preserve the previous configuration.
The six Survey Operations expose local target/item reads, attachment, complete question-map replacement, explicit scope preparation and counts-only Pull through both HTTP and MCP. The existing Offering Bridge tab drives them without background platform calls. Direct native DML and the actual generated apply artifact enforce immutable imported provenance and attachment-time semantics. Five additive migration folders remain unapplied; sync/governance re-emission was a genuine byte-identical no-op.
Survey session preparation uses an explicit mobilelearn paste and exact known-target probe in an isolated host-only jar. A successful scoped merge preserves the existing primary cookies; failures preserve the whole prior jar. Subsequent Survey reads use a mobilelearn host-only execution view, excluding inherited parent-domain cookies so they cannot silently select a different account. Broad Domain updates refuse. Explicit scope replacement advances session generation, while ordinary cookie rotation seals only that scope under the reservation checks. This proves readable target access, not cross-host account equality.
Fictional request/native SQL/HTTP/portal tests prove the implementation contracts. Actual Vault encryption, independent physical-reader privileges, live platform compatibility and the unfinished password/captcha/browser-coexistence proof remain separate deployment acceptance work. Migrations are additive and unapplied.