@nusoft/nuflow-pack-education-sen
v0.4.0
Published
NuFlow workflow pack for SEN schools — five v0.3 capture-family workflows (pupil event log, observation, intervention update, parent interaction, session note) plus the v0.4 Circle-2 DSL review workflow (dsl_review.capture) per WU 083.
Maintainers
Readme
@nusoft/nuflow-pack-education-sen
NuFlow workflow pack for SEN schools. Five capture-family workflows (v0.3 — pupil event log, observation, intervention update, parent interaction, session note) plus three v0.2 backward-compatibility workflows. Implements D015 — workflow packs as extension surface, D026–D030, and the cross-pack pattern conventions.
25/25 WU 072a conformance points verified on every test run.
Install
npm install @nusoft/nuflow-pack-education-sen @nusoft/nuflow@nusoft/nuflow is a peer dependency. The pack does not bundle it; the consumer chooses the runtime version. Recommended: @nusoft/nuflow@^0.3.1 for the WU 082 fix that rehydrates structured payload fields.
Use
import { createNuFlowRuntime } from "@nusoft/nuflow";
import { educationSenPack } from "@nusoft/nuflow-pack-education-sen";
const runtime = createNuFlowRuntime({
llmAdapter, // wrap with the deidentifier — see @nusoft/nuflow Phase 3 runbook
memoryContextAdapter,
workflowMemoryAdapter,
misWriteAdapter,
policyGates: educationSenPack.policyGates,
intentContracts: educationSenPack.intentContracts,
tenant: institutionId,
});
// Register all 8 workflows on the runtime.
educationSenPack.register(runtime);
// Drive a workflow:
const flow = await runtime.startWorkflow(
"pupil.event_log.record",
{ kind: "staff", id: staffId, role: "teacher" },
{
channel: "typed_note",
content: "Tyler had a meltdown after PE; sent to quiet room.",
subjects: [{ kind: "pupil", id: studentId }],
},
);
// → flow.writeIntent has the LLM-extracted fields; render a confirmation
// view, then runtime.confirmIntent / runtime.commitIntent to ship.v0.3 capture-family workflows
| Workflow type | Pattern | Purpose |
|---|---|---|
| pupil.event_log.record | event-log | Peer conflict, behavioural escalation, refusal, meltdown, near-miss, safeguarding-concern, environmental incident |
| pupil.observation.record | observation | Short, contemporaneous observation across nine categories (positive, concern, strategy outcome, strength, sensory, social, independence, other) |
| pupil.intervention_update.record | session-record (variant) | Update against an existing intervention with per-target progress + continuation choice (continue / modify / pause / discontinue) |
| pupil.parent_interaction.record | communication | Comms with parent / guardian / carer / foster-parent / social-worker / other-family — confidentiality + approval gating driven by correspondent role |
| pupil.session_note.record | session-record | Generic session note with sessionType discriminator (therapy / pastoral / key-worker / parent-meeting / multi-agency / other); therapy enforces clinical role |
Each workflow:
- Composes the six pack-internal
_shared/helpers (confidentiality,role-validation,capture-base,safeguarding-detection,decision-extraction,policy-gates). - Emits a
WriteIntentwith cross-workflow payload invariants —category,narrative,confidentiality,safeguardingIndicators,sourceChannel. - Routes confidentiality per D029. Consumer-overrideable.
- Declares
feedsIntoArticlesfor WU 081 (NuWiki compiled-article forward-compat).
Required capture metadata
Some workflows require additional metadata in capture.metadata:
| Workflow | Required metadata |
| --- | --- |
| pupil.intervention_update.record | interventionId: string; targetIds?: string[] (optional, threads into LLM prompt for per-target progress notes) |
| pupil.parent_interaction.record | correspondent: { name: string; role: 'parent'\|'guardian'\|'carer'\|'foster-parent'\|'social-worker'\|'other-family'; relationship?: string } |
| pupil.session_note.record | optional sessionType override; optional attendees: AttendeeRef[]; optional linkedTo: { interventionId?, priorSessionId? } |
Pass them via capture: { metadata: { ... } } when calling runtime.startWorkflow.
v0.2 backward-compat surface
| Workflow type | Status |
|---|---|
| incident.peer_conflict.record | recommended-deprecated; new consumers use pupil.event_log.record with eventType: 'peer-conflict' |
| attendance.note.record | unchanged |
| intervention.log.record | unchanged at registration boundary; new consumers prefer pupil.intervention_update.record for structured-progress updates |
Policy gates
educationSenPack.policyGates returns five composable PolicyGate factories:
educationSafeguardingGate(v0.2) — high/critical incidents → SLT+DSL approvalcreateSeverityDSLApprovalGate— high/critical severity → DSL+SLT approvalcreateSafeguardingDSLApprovalGate—safeguardingAdjacent: trueOReventType: 'safeguarding-concern'→ DSL approvalcreateInterventionDiscontinuationGate—continuationDecision: 'discontinue'→ SENCO approvalcreateOtherFamilyApprovalGate—correspondent.role: 'other-family'→ SENCO approval
Pass them on the runtime config: { policyGates: educationSenPack.policyGates }.
Conformance
Run the suite to confirm pack-shape compliance:
node --test tests/wu-072a-conformance.test.jsOn success the canonical line prints:
WU 072a — SEN pack v0.3 capture-family: 25/25 conformance points verifiedSections: §1 public surface, §2 pack composition, §3 capture-family payload contract, §4 single-pupil constraint, §5 WU 081 forward-compat, §6 role-validation specialisations.
Forbidden by D015
This pack does not modify NuFlow core, does not redefine the workflow runtime, does not depend on any specific consumer database. It contributes workflow definitions, intent contracts, and policy gates only — the canonical pack shape.
Versioning
Semver. Breaking changes to workflow shapes (subject kinds, payload fields, classification rubric, intent contract types) bump major. Additive changes bump minor. v0.3 is a minor bump from v0.2 — additive only.
License
MIT
