/wbDoc — Live Demo ()
This is what /wbDoc actually does on wb-labs as the workspace stands today (2026-05-05). The matrix below mirrors the exhaustive simulation, but every cell is filled from the live state of the repo.
1. Live target
| Field | Live value |
|---|---|
| Target package | core2/packages/wb-core |
| Key files needing docs | src/WBC.js (1200-line monolith — pre-decomposition), src/tierEnforcement.js, src/renderString.js |
| Existing JSDoc coverage | Partial — tierEnforcement.js has outdated @param names from a rename |
| README.md status | Exists but references the pre-decomposition file structure |
2. What each argument resolves to today
| Argument | Live resolution |
|---|---|
/wbDoc core2/packages/wb-core/src/tierEnforcement.js | Injects/updates JSDoc for 3 exported functions. Fixes stale userId → uuid param. |
/wbDoc core2/packages/wb-core | Updates README.md to reflect current exports. |
/wbDoc core2/packages/wb-core/src/WBC.js -S | Sync: detects 5 functions with outdated JSDoc, updates params without touching descriptions. |
/wbDoc core2/packages/wb-core/src/*.js -s | Strict: would fail on renderString.js (missing @returns on escapeHTML). |
3. Per-flag behavior, applied live
| Flag | If invoked now |
|---|---|
/wbDoc src/tierEnforcement.js | Overwrites existing JSDoc with fresh AST-derived blocks. |
/wbDoc src/tierEnforcement.js -S | Sync: updates only changed params. Preserves hand-written @description. |
/wbDoc src/*.js -s | ❌ Strict failed: renderString.js:escapeHTML() lacks @returns. |
/wbDoc src/*.js -d | Dry-run: previews all JSDoc changes without writing. |
/wbDoc packages/wb-core -f="readme" | Forces README generation even though the directory has .js files. |
4. Pipelines
/wbDoc Live Execution Simulator
Document the post-decomposition modules
/wbDoc core2/packages/wb-core/src/WBC.core.js,src/WBC.events.js> /wbDoc core2/packages/wb-core/src/WBC.core.js,src/WBC.events.js[SYSTEM] Targeting 2 files.
[AST] WBC.core.js: initWBC(), configureRuntime(), getWBCVersion(), WBCInstance class.
[AST] WBC.events.js: delegateEvent(), removeDelegate(), getEventDelegates().
[INJECT] WBC.core.js — 4 JSDoc blocks:
/**
* Initializes the WBC runtime. Called once per page load.
* @param {WBCConfig} config
* @returns {WBCInstance}
*/
export function initWBC(config) { ... }
[INJECT] WBC.events.js — 3 JSDoc blocks.
[CROSS-LINK] Shared type WBCInstance referenced in both files.
[OK] 7 functions documented across 2 files.
⚠️ Note: After row 3 (WBC.js decomposition) is complete, the new modules need documentation:
💠 Pipeline Document the post-decomposition modules
After row 3 (WBC.js decomposition) is complete, the new modules need documentation:
💠 Pipeline Sync stale docs after a rename
The tierEnforcement.js file had a parameter rename (userId → uuid) but the JSDoc wasn't updated:
💠 Pipeline README generation for the package
5. What would refuse today
| Trigger | Live response |
|---|---|
/wbDoc package.json | ⚠️ Cannot inject comments into JSON. Skipping. |
/wbDoc src/*.js -s | ❌ Strict failed. renderString.js:escapeHTML() has implicit return type. |
/wbDoc src/WBC.js -f="swagger" | ⚠️ WBC.js is not an API route file. Swagger format requires express/fastify routes. Falling back to jsdoc. |
/wbDoc src/legacy/eval_loader.js | ❌ AST cannot resolve dynamic exports (eval detected). Manual docs required. |
The pattern: /wbDoc writes documentation with the code's permission — it reads the AST, respects what it finds, and injects or generates accordingly. It never guesses types, never hallucinates exports, and never modifies execution logic.
