Problem
Wiii's LMS uploaded-document authoring flow can drift across runtime paths: direct node, direct tool-rounds, tool collection, SSE host action emission, and embed preview/apply UI. This caused teacher follow-up wording such as tao cho minh bai hoc to miss preview-first host action routing and risk hallucinated templates unrelated to the uploaded document.
Proposed Solution
Use OpenHuman as a reference architecture, without copying GPL code, to converge Wiii around Wiii-native contracts:
- clear agent turn lifecycle
- first-class host action approval contract
- deterministic uploaded document provenance/chunk IDs
- backend/frontend tool and capability sync
- source-aware context compaction before LLM calls
Spec artifacts: specs/001-openhuman-runtime-reliability/.
Area
- Chat pipeline
- Memory/identity
- RAG/retrieval
- LLM/provider runtime
- Tools/MCP
- LMS/embed/host context
- Desktop frontend
- Documentation/governance
Acceptance Criteria
- Uploaded Word/PDF teacher follow-up emits visible preview host action with source refs and no LMS mutation before approval.
- Apply uses preview/approval evidence before draft content appears in the course editor.
- Runtime document authoring intent is defined in one canonical backend contract and consumed by old direct runtime wrappers.
- Browser E2E evidence covers preview/apply/draft-visible.
- Risk and rollback notes are included before merge/deploy.
Non-Scope
- Replacing Wiii with OpenHuman.
- Copying GPL OpenHuman code.
- Broad unrelated cleanup or migrations in the first PR.
Risks and Constraints
High-risk surfaces include host control, LMS mutation, source/citation integrity, memory/provenance, tenant/org boundaries, SSE contract parity, and frontend bridge visibility. Changes must be split into reviewable PRs and deploy must remain blocked until real LMS/product E2E passes.
Alternatives Considered
Continue patching phrases in each runtime path separately. Rejected because duplicate routing logic already drifted and made the product behavior brittle.
Problem
Wiii's LMS uploaded-document authoring flow can drift across runtime paths: direct node, direct tool-rounds, tool collection, SSE host action emission, and embed preview/apply UI. This caused teacher follow-up wording such as
tao cho minh bai hocto miss preview-first host action routing and risk hallucinated templates unrelated to the uploaded document.Proposed Solution
Use OpenHuman as a reference architecture, without copying GPL code, to converge Wiii around Wiii-native contracts:
Spec artifacts:
specs/001-openhuman-runtime-reliability/.Area
Acceptance Criteria
Non-Scope
Risks and Constraints
High-risk surfaces include host control, LMS mutation, source/citation integrity, memory/provenance, tenant/org boundaries, SSE contract parity, and frontend bridge visibility. Changes must be split into reviewable PRs and deploy must remain blocked until real LMS/product E2E passes.
Alternatives Considered
Continue patching phrases in each runtime path separately. Rejected because duplicate routing logic already drifted and made the product behavior brittle.