@mmon-co/ncept-local 0.3.4 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,7 @@ const nodeList = { type: "array", items: { type: "string", pattern: "^node-" } }
31
31
  const graphProperties = {
32
32
  operations: {
33
33
  type: "array",
34
- description: 'Core operations use kind, not op. Create a Node with {"kind":"add-node","node":{"id":"node-example"}}; its label and criterion are separate: {"kind":"add-metadata-set","metadataSet":{"id":"metadata-example","subjects":[{"kind":"node","id":"node-example"}],"properties":{"display:label":"Example","pedagogy:criterion":"Observable success","pedagogy:knowledge-type":"conceptual"}}}. A prerequisite edge is {"kind":"add-edge","edge":{"id":"edge-example","from":"node-prerequisite","to":"node-example"}}. Other kinds: define-tag {tag:{name,nodes,edges,metadataSets}}, add-material/edit-material {material:{playground,type,id,about,content:{kind:"blob",hash,mediaType},meta}}, remove-material {playground,id}, mask-contribution {mask:{source:{identity,digest},operationIndex,entity:{kind,id},property?}}. Prefer the material tool for local files. Metadata properties belong to metadata sets, never directly on Nodes.',
34
+ description: "Core Patch operations using kind (add-node, add-edge, add-metadata-set, define-tag, mask-contribution, add-material/edit-material/remove-material). Metadata lives in metadata sets, not on Nodes; prefer the material tool for local files.",
35
35
  items: { type: "object" },
36
36
  },
37
37
  targets: nodeList,
@@ -217,7 +217,7 @@ export function hostTools(host, opened, capabilities, skills, metadataKeys) {
217
217
  return { content: { status: "draft", report: prepared.compiled.report, graph: prepared.compiled.graph } };
218
218
  });
219
219
  }
220
- mount("propose", 'Ask approval for a Mission, graph-diff/revision, or preferences. For mission, input.mission is {id,statement,targets:[{node,provenance:{identity,digest}}],priority}; the same id revises an existing Mission. A Mission may start with targets:[] before charting; after graph acceptance, use mission again to attach its targets with exact provenance from read graph. For graph-diff/revision, input:{} submits the current edit_graph_draft; input.targets optionally selects Node ids. For preferences, input.text is the new text. For mode, input is {mode,then,entry}; choose an allowed switch from context. Entry shapes: {kind:"goal",text}, {kind:"mission",id}, {kind:"target",node}, {kind:"review",nodes}, or {kind:"lesson",opening:{missionId,number}} (omit number for the next uncleared Lesson). Call mission without scope to include Missions not yet targeted; its path supplies Lesson numbers after targets are attached. No proposed Profile change is applied before confirm.', schema({
220
+ mount("propose", "Ask learner approval for a Mission (same id revises; targets:[] allowed before charting), graph-diff/revision (input:{} submits current edit_graph_draft), preferences, settings, or mode switch (choose an allowed switch from context). Nothing applies before confirm.", schema({
221
221
  op: { enum: ["mission", "graph-diff", "revision", "preferences", "settings", "mode"] },
222
222
  input: {
223
223
  type: "object",
package/dist/learning.js CHANGED
@@ -804,7 +804,7 @@ export class LearningHost {
804
804
  const settings = localSettings(view.profile);
805
805
  return {
806
806
  ...setup,
807
- prompt: setup.prompt +
807
+ prompt: `${setup.prompt.trimEnd()}\n- **${mechanics.name}**: ${mechanics.description}` +
808
808
  (typeof settings.preferences === "string" ? "\n\nLearner preferences:\n" + settings.preferences : ""),
809
809
  capabilities,
810
810
  context: [
package/dist/mechanics.js CHANGED
@@ -2,5 +2,30 @@
2
2
  export const mechanics = {
3
3
  name: "local-host",
4
4
  description: "A Material needs making, opening or reading back, or an outcome, change or reminder needs recording.",
5
- body: "The learner's work lives in the Profile directory; the Theory's tools, not you, decide what a record means.\n\n## Materials\n\nMake a Material with the `material` tool, in whatever form fits the capability: Markdown for reading, a quiz as a file of tasks with their answers, cards as one file of front/back pairs, an applet as an HTML page or a program in any language the learner can run, audio as a clip. The tool records it in the learner's map and checks out a working copy under `materials/<node>/`; a file you write there yourself is not a Material. Name each by what it teaches. Reuse a Material about the Node before making another. Show one by telling the learner its path (or running it for them when they have asked); what they change in the working copy is their work, read back as such.\n\n## Grading and outcomes\n\nGrade mechanically by running the check yourself where the answer is mechanical; otherwise judge the learner's work against the Node's criterion. Record the result only through the Theory's record tools (`record_material_attempt`, `record_demonstration`, `record_retrieval_opener`, `record_teaching`, `record_claim`, `record_retraction`, `close_recount`) with the task and the learner's response as they were; never write a label or edit the log. For quiz items answered in chat, use `record_material_attempt` with the Material identity (playground `local` for local files), item id, Node, task, response, outcome and unaided status. Use `record_demonstration` for ordinary conversational checks. A runner's existing item result is returned without duplication; correct a wrong grade with `evaluation_override` and a reason. The Theory validates the payload and refuses a malformed one; fix what it names.\n\n## Applets and read-back\n\nAn applet keeps its state in a file beside it. Read that file, or run its summary command, before describing the learner's position; do not rely on your last edit. A learner action arrives as the next message or as a file change you are told about; a program that needs your attention sends a notification (a terminal bell or the harness's own notice) and writes what happened to the state file first.\n\n## Notifications and wake-ups\n\nYou act only when the learner speaks or the harness runs you. To remind the learner or return later, write a scheduled prompt (the harness's scheduler or a note in `reminders.md`) naming the Node and the Session to resume; never promise a message you cannot send.\n\n## Changes\n\nA Mission, graph or guidance change is a proposal: show the diff as a file the learner can read and ask for approval in the harness's own prompt. Apply it through the Theory's operations only after they say yes. Nothing proposed is saved before that.\n",
5
+ body: `The learner's work lives in the Profile directory; the Theory's tools, not you, decide what a record means.
6
+
7
+ ## Materials
8
+
9
+ Create Materials with the \`material\` tool in whatever form fits: Markdown for reading, a file of tasks and answers for quizzes, a file of front/back pairs for cards, an HTML page or runnable program for an applet, or an audio clip. The tool records it in the learner's map and checks out a working copy under \`materials/<node>/\`—files written there directly are not Materials. Name each by what it teaches, reuse existing Materials on a Node before making another, and show one by giving its path (or running it when asked). Edits the learner makes in the working copy are their work—read them back as such.
10
+
11
+ ## Grading and outcomes
12
+
13
+ Grade mechanically by running checks yourself where answers are mechanical; otherwise judge against the Node's criterion. Record results only through the Theory's record tools (\`record_material_attempt\`, \`record_demonstration\`, \`record_retrieval_opener\`, \`record_teaching\`, \`record_claim\`, \`record_retraction\`, \`close_recount\`) with the verbatim task and learner response—never write labels or edit the log directly.
14
+
15
+ - Use \`record_material_attempt\` for quiz items answered in chat (playground \`local\` for local files, plus item id, Node, task, response, outcome, and \`unaided\`).
16
+ - Use \`record_demonstration\` for ordinary conversational checks.
17
+ - A runner's existing result is returned without duplication; fix a wrong grade with \`evaluation_override\` and a reason. Fix any validation errors the Theory returns.
18
+
19
+ ## Applets and read-back
20
+
21
+ Keep an applet's state in a file beside it, and read that file (or run its summary command) before describing the learner's position rather than relying on your last edit. Learner actions arrive in the next message or as file changes; an applet that needs attention writes its state file first, then notifies via terminal bell or the harness's notice.
22
+
23
+ ## Notifications and wake-ups
24
+
25
+ You act only when the learner speaks or the harness runs you. For reminders or later follow-ups, use the harness's scheduler or write a note in \`reminders.md\` naming the Node and Session to resume—never promise a message you cannot send.
26
+
27
+ ## Changes
28
+
29
+ Mission, graph, and guidance changes are proposals: show the diff as a readable file and ask approval through the harness's prompt. Apply them through the Theory's operations only after approval.
30
+ `,
6
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmon-co/ncept-local",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",