Repository navigation
Factory, CLI fix, content routing, session identity, WSL2 DNS - #581
Conversation
- Factory widget (event-driven, no polling) with forge monitor, output log, published models - model/forge-status command (reads status.json from forge nodes) - model/list-published command (fetches HF API, caches 5min) - HF org card template at docs/HUGGINGFACE-ORG-CARD.md - Generator specs for both commands
There was a problem hiding this comment.
Pull request overview
This PR mixes a WSL2 boot-time DNS fix with the introduction of a new “Factory” UI surface and two new model-related commands (plus related docs/assets) in the Continuum/JTAG codebase.
Changes:
- Update
wsl-boot.shto derive DNS from the LAN gateway and attempt to disable WSL resolv.conf auto-generation. - Add
FactoryWidget+/factoryrecipe for a model-forge “production floor” UI. - Add
model/list-published(HuggingFace org listing) andmodel/forge-status(read forgestatus.json) command scaffolding, specs, docs, and tests.
Reviewed changes
Copilot reviewed 25 out of 34 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/scripts/wsl-boot.sh | Changes DNS boot logic and edits /etc/wsl.conf to stop resolv.conf regeneration |
| src/widgets/factory/FactoryWidget.ts | Adds new ReactiveWidget UI for forge status, output log, and published models |
| src/widgets/factory/README.md | Documents the Factory widget structure/usage/styling |
| src/widgets/factory/public/factory-widget.html | Adds a static HTML template placeholder for Factory widget (not referenced by current TS) |
| src/widgets/factory/public/factory-widget.scss | Adds minimal SCSS source placeholder for Factory widget |
| src/system/recipes/factory.json | Adds a new recipe routing /factory to factory-widget |
| src/generator/specs/model-list-published.json | Adds command spec for listing published models from HuggingFace org |
| src/generator/specs/model-forge-status.json | Adds command spec for querying forge status across nodes |
| src/commands/model/list-published/shared/ModelList-publishedTypes.ts | Adds shared types + executor wrapper for model/list-published |
| src/commands/model/list-published/server/ModelList-publishedServerCommand.ts | Implements server-side HuggingFace API fetch + caching and filters |
| src/commands/model/list-published/browser/ModelList-publishedBrowserCommand.ts | Browser stub delegating to server via remoteExecute |
| src/commands/model/list-published/package.json | Adds package metadata/scripts (currently mismatched entrypoints vs filenames) |
| src/commands/model/list-published/README.md | Adds user-facing command documentation |
| src/commands/model/list-published/.npmignore | Adds npm ignore rules for the command package |
| src/commands/model/list-published/test/unit/ModelList-publishedCommand.test.ts | Adds generated “reference example” unit test scaffold |
| src/commands/model/list-published/test/integration/ModelList-publishedIntegration.test.ts | Adds generated integration test scaffold |
| src/commands/model/forge-status/shared/ModelForge-statusTypes.ts | Adds shared types + executor wrapper for model/forge-status |
| src/commands/model/forge-status/server/ModelForge-statusServerCommand.ts | Implements server-side status.json scanning/parsing into forge job status |
| src/commands/model/forge-status/browser/ModelForge-statusBrowserCommand.ts | Browser stub delegating to server via remoteExecute |
| src/commands/model/forge-status/package.json | Adds package metadata/scripts (currently mismatched entrypoints vs filenames) |
| src/commands/model/forge-status/README.md | Adds user-facing command documentation |
| src/commands/model/forge-status/.npmignore | Adds npm ignore rules for the command package |
| src/commands/model/forge-status/test/unit/ModelForge-statusCommand.test.ts | Adds generated “reference example” unit test scaffold |
| src/commands/model/forge-status/test/integration/ModelForge-statusIntegration.test.ts | Adds generated integration test scaffold |
| docs/HUGGINGFACE-ORG-CARD.md | Adds HuggingFace org card content for continuum-ai |
| docs/images/continuum-logo-dark.svg | Adds a dark SVG logo asset |
| docs/images/snake-game-sonnet-4.6-qwen-27B-14GB-compressed-capture.png | Adds a PNG screenshot asset |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # a broken nameserver. External DNS (8.8.8.8) doesn't work because WSL2's NAT | ||
| # blocks outbound UDP port 53. The fix: use the LAN gateway (router) which is | ||
| # always reachable from WSL2. | ||
| GATEWAY=$(ip route show default 2>/dev/null | awk '{print $3}') |
There was a problem hiding this comment.
ip route show default | awk '{print $3}' can yield the wrong value (e.g., dev routes produce an interface name rather than a gateway IP). Consider extracting the token after via (or falling back to parsing default via ...) so /etc/resolv.conf always gets a valid IP address.
| GATEWAY=$(ip route show default 2>/dev/null | awk '{print $3}') | |
| GATEWAY=$(ip route show default 2>/dev/null | awk '{for(i=1;i<=NF;i++) if($i=="via"){print $(i+1); exit}}') |
| # 0. Fix DNS | ||
| # WSL2 auto-generates resolv.conf pointing at Tailscale DNS (10.255.255.254) or | ||
| # a broken nameserver. External DNS (8.8.8.8) doesn't work because WSL2's NAT | ||
| # blocks outbound UDP port 53. The fix: use the LAN gateway (router) which is | ||
| # always reachable from WSL2. |
There was a problem hiding this comment.
PR title/description focus on WSL2 DNS, but this PR also adds a new Factory widget, multiple model commands, recipes, and documentation/images. Please either split these into separate PRs or update the PR metadata to reflect the broader scope so reviewers can assess risk appropriately.
| this.forgeStatus = { | ||
| ...this.forgeStatus, | ||
| phase: data.phase, | ||
| detail: data.detail ?? '', | ||
| timestamp: data.timestamp ?? new Date().toISOString(), |
There was a problem hiding this comment.
{ ...this.forgeStatus, ... } will throw when this.forgeStatus is still null (spreading null/undefined is a runtime TypeError). Initialize a default object (e.g., ...(this.forgeStatus ?? {})) or guard before merging.
| Events.subscribe('model:forge:sample', (data: any) => { | ||
| this.outputSamples = [...this.outputSamples, { | ||
| step: data.step ?? 0, | ||
| prompt: data.prompt ?? '', | ||
| output: data.output ?? '', |
There was a problem hiding this comment.
outputSamples grows without bound (each sample event appends forever). Consider capping this array to a reasonable max (similar to lossHistory.slice(-50)) to avoid long-session memory growth and slow renders.
| const result = await this.executeCommand<any, any>('model/list-published', {}); | ||
| if (result?.models) { | ||
| this.models = result.models; | ||
| } |
There was a problem hiding this comment.
model/list-published returns fields like improvementPct and sizeGb, but this widget’s PublishedModel expects improvement and size strings. As written, the UI will render undefined and parseFloat(m.improvement) will be NaN. Map the command result into the widget shape or switch the widget to the shared PublishedModelInfo type.
| # Disable auto-generation permanently | ||
| if ! grep -q "generateResolvConf" /etc/wsl.conf 2>/dev/null; then | ||
| echo -e "\n[network]\ngenerateResolvConf = false" >> /etc/wsl.conf |
There was a problem hiding this comment.
The /etc/wsl.conf update only appends a stanza when generateResolvConf is absent; it won’t correct an existing generateResolvConf = true, and it can also create duplicate [network] sections. Prefer editing/overriding the existing key to false (idempotently) rather than only appending.
| # Disable auto-generation permanently | |
| if ! grep -q "generateResolvConf" /etc/wsl.conf 2>/dev/null; then | |
| echo -e "\n[network]\ngenerateResolvConf = false" >> /etc/wsl.conf | |
| # Disable auto-generation permanently (idempotent update of /etc/wsl.conf) | |
| if [ ! -f /etc/wsl.conf ]; then | |
| printf "[network]\n" > /etc/wsl.conf | |
| printf "generateResolvConf = false\n" >> /etc/wsl.conf | |
| elif grep -q "^[[:space:]]*generateResolvConf[[:space:]]*=" /etc/wsl.conf 2>/dev/null; then | |
| # Force any existing generateResolvConf setting to false | |
| sed -i 's/^[[:space:]]*generateResolvConf[[:space:]]*=.*/generateResolvConf = false/' /etc/wsl.conf | |
| elif grep -q "^\[network\]" /etc/wsl.conf 2>/dev/null; then | |
| # Insert generateResolvConf = false inside existing [network] section | |
| tmp_conf=$(mktemp /tmp/wsl.conf.XXXXXX) | |
| awk '{ | |
| print $0; | |
| if ($0 ~ /^\[network\]/) { | |
| print "generateResolvConf = false"; | |
| } | |
| }' /etc/wsl.conf > "$tmp_conf" | |
| mv "$tmp_conf" /etc/wsl.conf | |
| else | |
| # No [network] section at all; append a new one | |
| printf "\n[network]\n" >> /etc/wsl.conf | |
| printf "generateResolvConf = false\n" >> /etc/wsl.conf |
| private subscribeToForgeEvents(): void { | ||
| // Subscribe to forge lifecycle events — emitted by the forge daemon/grid node | ||
| Events.subscribe('model:forge:step', (data: any) => { | ||
| this.forgeStatus = { |
There was a problem hiding this comment.
Subscriptions returned by Events.subscribe(...) aren’t stored, so disconnectedCallback() can’t unsubscribe. This can leak listeners and cause duplicate updates if the widget is re-mounted. Capture unsubscribe fns and call them on disconnect (see TrainingDashboardWidget’s _cleanups).
| const samples = [...this.outputSamples].reverse(); | ||
|
|
||
| return html` | ||
| <div class="section"> | ||
| <div class="section-title">Output Log (${samples.length})</div> |
There was a problem hiding this comment.
The output log reverses outputSamples for display and uses the display index as the expansion key (_expandedSample). When new samples arrive, indices shift and the expanded entry can jump to a different sample. Track expansion by a stable identifier (e.g., timestamp/step) rather than the mapped index.
| const forge: ForgeJobStatus = { | ||
| nodeId: 'local', | ||
| nodeName: path.basename(dir), | ||
| phase: status.phase ?? 'unknown', | ||
| detail: status.detail ?? '', |
There was a problem hiding this comment.
ForgeJobStatus.phase is a narrow union, but the server sets phase: status.phase ?? 'unknown' (and status.phase can be any string from JSON). Normalize/validate to known phase values, or widen the shared type to include 'unknown', so the command output is type-safe.
| /* FactoryWidget — styles are inline in FactoryWidget.ts via Lit css`` */ | ||
| :host { display: block; } |
There was a problem hiding this comment.
The SCSS comment says styles are inline in FactoryWidget.ts but the comment contains stray backticks (css```) and the repo’s SCSS compiler expects these .scssfiles to be real sources for generated.css/.styles.ts`. Either remove this SCSS file if unused, or make it the actual source of truth (and fix the comment).
…llel GGUF + inference
…kers, cyberpunk forge button
Browser session creation was converting undefined userId to 00000000-0000-0000-0000-000000000000 before the server could resolve real identity from deviceId/seeded owner. Server already handles identity resolution correctly — the browser command was poisoning params.userId unnecessarily.
Every feature is a room with a recipe. Factory foreman lives here.
343 commands had userId defaulting to SYSTEM_SCOPES.SYSTEM. Generator template was the source. New commands won't get this cancer.
Every room now opens with its recipe-driven widget instead of always loading chat-widget. Factory room → factory-widget. Logs → log-viewer. This was the #362 content routing cancer — hardcoded 'chat' in selectRoom().
Without this, navigating to Factory would hide the room list and trap the user with no way to navigate back.
… time Seven generator files had if(require.main===module) blocks with readFileSync. esbuild inlined the condition as true, causing readFileSync(argv[0]) to run when the CLI bundle loaded — breaking ./jtag completely. Moved CLI entry points out of importable modules. Generators now run via npx tsx generator/<name>.ts directly.
Summary
28 commits covering:
Critical fixes:
Factory:
HuggingFace:
Gap analysis:
Test plan