feat: add value-free teacher mode - #2699
Conversation
|
@alectimison-maker is attempting to deploy a commit to the esokullu's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Review finding: request changes before merge. Teacher mode prevents Suggested fix:
Validation otherwise looks good: local Since #2698 has now merged, this branch also needs a rebase/conflict resolution that preserves both the workflow-manager UI and the |
85728f3 to
38beb4a
Compare
|
Implemented the requested teacher/run exclusion and rebased the PR onto current main while retaining the teacher-mode work. What changed:
Validation:
PR head is now 38beb4a and GitHub reports it mergeable; the WebMCP smoke check is queued. |
|
Follow-up: the WebMCP smoke check completed successfully (22s). The only remaining failing status is Vercel's external authorization-required check. |
There was a problem hiding this comment.
Pull request overview
Adds value-free Teacher mode for capturing user demonstrations and compiling them into reusable saved workflows.
Changes:
- Adds
/teachsession capture, workflow compilation, and guarded replay integration. - Adds Chrome/Firefox parity, localization, and automated tests.
- Documents Teacher mode, architecture, and privacy behavior.
Reviewed changes
Copilot reviewed 70 out of 72 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
test/run.js |
Adds Teacher-mode compilation, storage, interlock, and wiring tests. |
src/firefox/src/ui/sidepanel.js |
Adds Firefox /teach commands and UI handling. |
src/firefox/src/ui/locales/zh.js |
Adds Chinese Teacher-mode strings. |
src/firefox/src/ui/locales/vi.js |
Adds Vietnamese Teacher-mode strings. |
src/firefox/src/ui/locales/uk.js |
Adds Ukrainian Teacher-mode strings. |
src/firefox/src/ui/locales/tr.js |
Adds Turkish Teacher-mode strings. |
src/firefox/src/ui/locales/tl.js |
Adds Tagalog Teacher-mode strings. |
src/firefox/src/ui/locales/th.js |
Adds Thai Teacher-mode strings. |
src/firefox/src/ui/locales/ru.js |
Adds Russian Teacher-mode strings. |
src/firefox/src/ui/locales/pt.js |
Adds Portuguese Teacher-mode strings. |
src/firefox/src/ui/locales/pl.js |
Adds Polish Teacher-mode strings. |
src/firefox/src/ui/locales/nl.js |
Adds Dutch Teacher-mode strings. |
src/firefox/src/ui/locales/ms.js |
Adds Malay Teacher-mode strings. |
src/firefox/src/ui/locales/ko.js |
Adds Korean Teacher-mode strings. |
src/firefox/src/ui/locales/ja.js |
Adds Japanese Teacher-mode strings. |
src/firefox/src/ui/locales/id.js |
Adds Indonesian Teacher-mode strings. |
src/firefox/src/ui/locales/hi.js |
Adds Hindi Teacher-mode strings. |
src/firefox/src/ui/locales/he.js |
Adds Hebrew Teacher-mode strings. |
src/firefox/src/ui/locales/fr.js |
Adds French Teacher-mode strings. |
src/firefox/src/ui/locales/fa.js |
Adds Persian Teacher-mode strings. |
src/firefox/src/ui/locales/es.js |
Adds Spanish Teacher-mode strings. |
src/firefox/src/ui/locales/en.js |
Adds English Teacher-mode strings. |
src/firefox/src/ui/locales/de.js |
Adds German Teacher-mode strings. |
src/firefox/src/ui/locales/bn.js |
Adds Bengali Teacher-mode strings. |
src/firefox/src/ui/locales/ar.js |
Adds Arabic Teacher-mode strings. |
src/firefox/src/content/teacher-capture.js |
Captures trusted, value-free Firefox demonstrations. |
src/firefox/src/content/accessibility-tree.js |
Exposes semantic role lookup. |
src/firefox/src/background.js |
Coordinates Firefox Teacher sessions and workflow saving. |
src/firefox/src/agent/workflows.js |
Compiles demonstrations into saved workflows. |
src/firefox/src/agent/teacher-mode.js |
Implements session storage and run interlocking. |
src/firefox/src/agent/scheduler.js |
Reserves scheduled-run tabs against Teacher mode. |
src/firefox/src/agent/agent.js |
Adds guarded run claiming. |
src/firefox/manifest.json |
Registers the Teacher capture script. |
src/chrome/src/ui/sidepanel.js |
Adds Chrome /teach commands and UI handling. |
src/chrome/src/ui/locales/zh.js |
Adds Chinese Teacher-mode strings. |
src/chrome/src/ui/locales/vi.js |
Adds Vietnamese Teacher-mode strings. |
src/chrome/src/ui/locales/uk.js |
Adds Ukrainian Teacher-mode strings. |
src/chrome/src/ui/locales/tr.js |
Adds Turkish Teacher-mode strings. |
src/chrome/src/ui/locales/tl.js |
Adds Tagalog Teacher-mode strings. |
src/chrome/src/ui/locales/th.js |
Adds Thai Teacher-mode strings. |
src/chrome/src/ui/locales/ru.js |
Adds Russian Teacher-mode strings. |
src/chrome/src/ui/locales/pt.js |
Adds Portuguese Teacher-mode strings. |
src/chrome/src/ui/locales/pl.js |
Adds Polish Teacher-mode strings. |
src/chrome/src/ui/locales/nl.js |
Adds Dutch Teacher-mode strings. |
src/chrome/src/ui/locales/ms.js |
Adds Malay Teacher-mode strings. |
src/chrome/src/ui/locales/ko.js |
Adds Korean Teacher-mode strings. |
src/chrome/src/ui/locales/ja.js |
Adds Japanese Teacher-mode strings. |
src/chrome/src/ui/locales/id.js |
Adds Indonesian Teacher-mode strings. |
src/chrome/src/ui/locales/hi.js |
Adds Hindi Teacher-mode strings. |
src/chrome/src/ui/locales/he.js |
Adds Hebrew Teacher-mode strings. |
src/chrome/src/ui/locales/fr.js |
Adds French Teacher-mode strings. |
src/chrome/src/ui/locales/fa.js |
Adds Persian Teacher-mode strings. |
src/chrome/src/ui/locales/es.js |
Adds Spanish Teacher-mode strings. |
src/chrome/src/ui/locales/en.js |
Adds English Teacher-mode strings. |
src/chrome/src/ui/locales/de.js |
Adds German Teacher-mode strings. |
src/chrome/src/ui/locales/bn.js |
Adds Bengali Teacher-mode strings. |
src/chrome/src/ui/locales/ar.js |
Adds Arabic Teacher-mode strings. |
src/chrome/src/content/teacher-capture.js |
Captures trusted, value-free Chrome demonstrations. |
src/chrome/src/content/accessibility-tree.js |
Exposes semantic role lookup. |
src/chrome/src/cloud-runs.js |
Interlocks cloud-run startup with Teacher mode. |
src/chrome/src/background.js |
Coordinates Chrome Teacher sessions and workflow saving. |
src/chrome/src/agent/workflows.js |
Compiles demonstrations into saved workflows. |
src/chrome/src/agent/teacher-mode.js |
Implements session storage and run interlocking. |
src/chrome/src/agent/scheduler.js |
Reserves scheduled-run tabs against Teacher mode. |
src/chrome/src/agent/agent.js |
Adds guarded run claiming. |
src/chrome/manifest.json |
Registers the Teacher capture script. |
README.md |
Lists the new Teacher commands. |
docs/zh-CN/slash-commands.md |
Documents Teacher commands in Chinese. |
docs/slash-commands.md |
Documents Teacher command usage. |
docs/privacy-and-data-flow.md |
Describes value-free capture and storage. |
docs/fr/slash-commands.md |
Documents Teacher commands in French. |
docs/architecture.md |
Documents Teacher-mode architecture. |
Files not reviewed (2)
- src/chrome/src/ui/locales/bn.js: Generated file
- src/chrome/src/ui/locales/hi.js: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| document.addEventListener('keydown', (event) => { | ||
| if (!active || !event.isTrusted || event.key !== 'Enter' || event.repeat) return; | ||
| const element = actionableFromEvent(event); | ||
| if (!isField(element) || element.matches('textarea,[contenteditable]')) return; | ||
| dirtyFields.delete(element); | ||
| submittedFields.set(element, Date.now()); | ||
| enterSubmitAt = Date.now(); | ||
| sendAction({ kind: 'field', submit: true, target: semanticTarget(element, { field: true }) }); |
| document.addEventListener('keydown', (event) => { | ||
| if (!active || !event.isTrusted || event.key !== 'Enter' || event.repeat) return; | ||
| const element = actionableFromEvent(event); | ||
| if (!isField(element) || element.matches('textarea,[contenteditable]')) return; | ||
| dirtyFields.delete(element); | ||
| submittedFields.set(element, Date.now()); | ||
| enterSubmitAt = Date.now(); | ||
| sendAction({ kind: 'field', submit: true, target: semanticTarget(element, { field: true }) }); |
| const recentClick = options.force !== true | ||
| && session.lastActionKind === 'click' | ||
| && now() - session.lastActionAt < 2000; | ||
| session.currentScope = destination; | ||
| if (sameScope || recentClick) return { changed: true, reason: '', session: await write(session) }; |
| const recentClick = options.force !== true | ||
| && session.lastActionKind === 'click' | ||
| && now() - session.lastActionAt < 2000; | ||
| session.currentScope = destination; | ||
| if (sameScope || recentClick) return { changed: true, reason: '', session: await write(session) }; |
| throw new Error('Saved workflow is missing or invalid.'); | ||
| } | ||
| await this._hydrate(tabId); | ||
| await this._claimRunEntry(tabId, 'workflow', runOptions); |
| throw new Error('Saved workflow is missing or invalid.'); | ||
| } | ||
| await this._hydrate(tabId); | ||
| await this._claimRunEntry(tabId, 'workflow', runOptions); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Summary
/teach --start <name>,/teach, and/teach --endwebbrain-workflow/1formatDesign
Teacher mode captures trusted top-document clicks, field completion,
checkbox/radio changes, Enter submissions, and navigation.
Field values are never read or stored. A demonstrated field is converted
directly into a runtime workflow parameter at the capture/compiler boundary.
URLs are reduced to sanitized origins, path families, and query-free replay
destinations.
Temporary sessions live in
storage.session, survive navigation and serviceworker restarts, and are always removed by
/teach --end, including failedcompilations. Unsafe targets and actions beyond the workflow limit are skipped
with explicit warnings.
This introduces no new workflow schema or browser permissions.
Scope
and explicit navigation
Testing
node test/run.js: 1518 passed, 1 existing upstream failure26.2.2is newer than the latestchangelog entry
26.2.0pending-field flush, duplicate-submit suppression, and value non-retention
Closes #197