Skip to content

Factory, CLI fix, content routing, session identity, WSL2 DNS - #581

Merged
joelteply merged 28 commits into
mainfrom
feature/image-updates
Mar 29, 2026
Merged

joelteply merged 28 commits into
mainfrom
feature/image-updates

Conversation

@joelteply

@joelteply joelteply commented Mar 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

28 commits covering:

Critical fixes:

Factory:

  • Factory widget with Start Forge controls, event-driven monitoring
  • Factory room seeded with recipe
  • model/forge-status and model/list-published commands generated

HuggingFace:

  • Org card: device targets (iPhone to Roomba), Chinese label, Qwen credit
  • GGUF model card with benchmark progress

Gap analysis:

Test plan

  • npm run build:ts passes
  • ./jtag ping returns real userId (18db7494, not all-zeros)
  • AIs respond in browser chat
  • Factory room appears in room list
  • npm start detects browser and refreshes (not opens new tab)

- 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
Copilot AI review requested due to automatic review settings March 29, 2026 04:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to derive DNS from the LAN gateway and attempt to disable WSL resolv.conf auto-generation.
  • Add FactoryWidget + /factory recipe for a model-forge “production floor” UI.
  • Add model/list-published (HuggingFace org listing) and model/forge-status (read forge status.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.

Comment thread src/scripts/wsl-boot.sh
# 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}')

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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}}')

Copilot uses AI. Check for mistakes.
Comment thread src/scripts/wsl-boot.sh
Comment on lines +11 to +15
# 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.

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +114 to +118
this.forgeStatus = {
...this.forgeStatus,
phase: data.phase,
detail: data.detail ?? '',
timestamp: data.timestamp ?? new Date().toISOString(),

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ ...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.

Copilot uses AI. Check for mistakes.
Comment on lines +122 to +126
Events.subscribe('model:forge:sample', (data: any) => {
this.outputSamples = [...this.outputSamples, {
step: data.step ?? 0,
prompt: data.prompt ?? '',
output: data.output ?? '',

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +150 to +153
const result = await this.executeCommand<any, any>('model/list-published', {});
if (result?.models) {
this.models = result.models;
}

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread src/scripts/wsl-boot.sh
Comment on lines +18 to +20
# Disable auto-generation permanently
if ! grep -q "generateResolvConf" /etc/wsl.conf 2>/dev/null; then
echo -e "\n[network]\ngenerateResolvConf = false" >> /etc/wsl.conf

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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

Copilot uses AI. Check for mistakes.
Comment on lines +94 to +97
private subscribeToForgeEvents(): void {
// Subscribe to forge lifecycle events — emitted by the forge daemon/grid node
Events.subscribe('model:forge:step', (data: any) => {
this.forgeStatus = {

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines +579 to +583
const samples = [...this.outputSamples].reverse();

return html`
<div class="section">
<div class="section-title">Output Log (${samples.length})</div>

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +46
const forge: ForgeJobStatus = {
nodeId: 'local',
nodeName: path.basename(dir),
phase: status.phase ?? 'unknown',
detail: status.detail ?? '',

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
/* FactoryWidget — styles are inline in FactoryWidget.ts via Lit css`` */
:host { display: block; }

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
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.
@joelteply joelteply changed the title Fix WSL2 DNS: use LAN gateway, disable auto-generation Factory, CLI fix, content routing, session identity, WSL2 DNS Mar 29, 2026
@joelteply
joelteply merged commit 8560787 into main Mar 29, 2026
2 of 5 checks passed
@joelteply
joelteply deleted the feature/image-updates branch March 29, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants