Spaces:
Running
Running
Commit History
5 days ago
-
fix(sonar): wave 7 - cleanup round from live scan (93 findings across 65 files)
Z User- 34 in-scope follow-ups exposed by the 17:59 scan (refactor residuals: S3776 helper splits, S4323 type aliases, S6759 readonly on extracted components, S8786 bounded-regex justifications, S6551 scrub patterns, S9440/S7924 CSS at new positions) - python leftovers: 29x S1481 positional _, S8786 regex canonicalization (fuzz-verified), S3776 task24 step-fn hoisting, S1192 dialog/content-type consts - operator tooling: S9382 documented NOSONARs for deliberate poll/throttle loops + Promise.all for independent probes, S8689 second log site routed through redact(), S5144 second fetch site behind UPSTREAM_HOST_ALLOWLIST Verified: tsc clean, vitest 1394/1394, node --check + py_compile on touched scripts.6780540 -
fix(sonar): wave 5 - final in-scope sweep, 92 findings across 67 files (complete: 994/994 in-scope)
Z User- 23 two-count files + 44 one-count files: S6582/S7503/S7755/S7773/ S7780/S8786/S9382/S3776/S6759/S6819/S5906/S5976/S3863/S7763/S7785/ S8782/S4138/S7744/S6606/S4624/S7778/S7754 - google-auth-router 47->11, shield 39->6, security middleware 24->8, ForgotPassword 34->4, VerifyEmail 22->5, Courses 28->13 (DOM identical) - S9382 NOSONAR only for: Redis connection retry backoff, migration ledger order - both documented sequential necessities - contract tests re-pinned: issueSessionResponse centralization (both session paths categorize), isHostGateExempt approval-action exemption Verified: tsc clean, eslint 0 errors, vitest 1394/1394.6165987 -
fix(sonar): wave 4 - resolve 114 findings (payment-router, sld render/repair, chatbot-prompts, cache, Register, ArticleDetail, chat-format, user-ai-provider, image-quota, email, chatbot-errors, push-state, Footer, notes-router, local-auth, think-filter, settings/maintenance/paymob routers, youtube-watcher, referral, env)
Z User- S3776 extractions (getSystemPrompt via SystemPromptArgs, chatbot-prompts 51->15, email OTP verify flow, local-auth register/login/updateProfile) - S9382: NOSONAR only for documented sequential necessities (Redis SCAN pagination, bulkUpsert pool cap, ordered SQL dump, oEmbed concurrency pool) - S8786: credential regex de-duplicated quantifiers, email validator split, UA WebView regex preserved via differential corpus test - S6551: describeCause/JSON diagnostics; S6759 readonly props; S5906 in tests - contract tests re-pinned to helper-based equivalents (2FA helper call site, finalizeEmailVerification pendingEmail flow, changeEmailWithVerification rate-limit-inside-branch) - all runtime invariants unchanged Verified: tsc clean, eslint 0 errors, vitest 1394/1394.da57150
9 days ago
-
chore(biome): eliminate the organizeImports class repo-wide + close every remaining biome error
Z UserThe three organizeImports errors documented on the avatar feature (review- router, CourseReviews, ChatBot) were one instance of a repo-wide class: 17 assist/source/organizeImports diagnostics across 15 files, all on untouched import blocks. biome check --write applied the safe mechanical reorder (no side-effect-only imports moved — verified against the full diff; the 1391-test suite + tsc + build all pass unchanged). Also closed so `npx biome check .` now exits clean: - email-templates.ts useTemplate: concat → template literal - chatbot-cables-kb.ts noApproximativeNumericConstant ×2: biome-ignore with justification — ac 1.442 Ω/km is measured IEC cable data, NOT the log2(e) constant the rule suspects; auto-fix would have corrupted the table - admin-learning.ts usePlaywrightValidDescribeCallback ×3: biome-ignore — `describe` there is the local error formatter (line 238) for the DB canary diagnostics, not a test-runner describe18afd52
21 days ago
-
fix(a11y+lint): zero biome errors — real a11y cures, YT resume race fix, sanitizer widened
ahmdelbaz28-uxBiome 2.6.2 migration (schema matched to CLI) surfaced 31 latent findings; every one is resolved at the root — suppressions only where intentional: REAL BUGS fixed: - YouTubeLessonPlayer auto-resume race: the effect keyed only [ready, lessonId] so progress resolving AFTER player-ready never resumed — lessons silently restarted from 0:00 on slow networks. Now guarded once-per-lesson (resumedLessonRef) with savedProgress in deps; first of (ready AND progress) wins, refetches never re-seek mid-playback. - Admin testimonial form: 6 labels unassociated with controls — proper htmlFor/id pairs so screen readers announce every field. - CourseReviews: stars row gains role=img (aria-label now honored); rating buttons rebuilt as REAL radio inputs inside labels (keyboard-accessible, native checked state); stray <label> with no control becomes a <span>. - ChatBot feedback row: role=group div -> fieldset (border reset via classes). - CommentNudge: role=complementary div -> semantic <a…7e3d3ff
22 days ago
-
fix: clear all SonarCloud BUGs/VULNERABILITIES/BLOCKERs + perf + a11y quality floor
Z UserInstalled 5 external skills (triage-sonarqube from netdata, react-performance + production-audit from ECC, frontend-design from anthropics, systematic- debugging from obra/superpowers) and ran their workflows against the repo. SonarCloud (project ahmdelbaz28-ux_elbaz-platform, public API) reported 987 open findings: 3 BUG, 10 VULNERABILITY, 2 BLOCKER. ALL 15 real defects are fixed here, root-caused first per systematic-debugging: BUGS - S2871 (CRITICAL) api/lib/sld/repair.ts:125 + lint.ts:125: [a,b].sort() without comparator on wire-key strings -> localeCompare comparator. Only 2 occurrences repo-wide (grep-verified). - S7493 (MAJOR) scripts/shot_sld_qa.py:22: synchronous open() inside async main() blocked the event loop -> asyncio.to_thread write. VULNERABILITIES - S5443 (CRITICAL) x4 (yt_playback_proof_prod, yt_playlist_admin_import_prod, push_unavailable_live_e2e, push_toggle_live_e2e): admin session state and persistent browser profiles (REAL credentials) lived in world…9c15d63
-
fix(sld): real busbar connection allocator — cables attach ON the bar, never bunched, never shared-lane
Z UserRoot fix for the user-rejected render (motor + lighting fed from one bus): - per-wire slot allocator: every wire touching a busbar gets its own X on the correct edge (top=in, bottom=out), ordered by the far endpoint so wires never cross, spread with a forward/backward sweep enforcing >= 24px separation - short busbars auto-grow (pre-lint, collision-checked) so their connections always fit at proper spacing - horizontal-lane allocator: each turn takes a collision-checked lane — no two horizontal runs share or touch the same Y (collinear overlap is structurally impossible now, not just unlikely) - straight-drop snap kills the tiny Z-jogs seen under breakers - junction dots paint AFTER bodies: fully visible ON the bar edge - diagram URL cache-buster v=3 -> v=4 - 8 new routing contract tests (attachment, slot separation, lane uniqueness, auto-grow, snap, dots) — suite: 466 passing85a5b48 -
fix(sld): ASCII-safe repair audit trail — X-Sld-Repair header 500 on GET
Z UserLive proof round: POST /api/diagrams/sld repaired an overlapping spec (200 + relocate actions) but GET 500'd — the X-Sld-Repair header carried em-dashes (non-latin1 → ERR_INVALID_CHAR). Root fix: repair actions are ASCII-only by contract (em-dashes removed), the router additionally scrubs the header value ([^\x20-\x7E] -> '?') because raw model ids flow through the trail. Also: E2E chip locator now matches BOTH localized labels (the chip correctly follows UI language, not message language).048cf59 -
fix(sld): root-cause repairs — server-side spec repair + img-failure fallback + detector depth
Z UserRoot review of d37025f found two real holes, both closed at the source: 1) 422 → broken <img> in chat: the diagrams GET rendered nothing for a lint-failing spec (overlap, bad/duplicate ids), violating the router's own 'chat never breaks' contract at the last step, and the draw-now chip hid because a shape-valid fence was treated as delivered. Root fix: api/lib/sld/repair.ts — deterministic repair pass (sanitize ids, dedupe with first-occurrence wire mapping, drop dead wires, first-fit overlap relocation down/right/diag). Router GET/POST render the repaired spec; X-Sld-Repair header carries the audit trail; only a still-failing repair answers 422. renderSld/lintSpec untouched. 2) Residual broken-image icons: MessageBubble now attaches error listeners to SLD imgs and swaps failures for a localized note (createElement + textContent only — no model content). Detector depth: past-tense delivery claims (جهزت/حضرت/رسمت + المخطط), 'المخطط التالي/الآتي', EN 'the…e3276d9 -
fix(sld): rtl base direction for labels + self-collision and dense-row escapes
Z UserLive visual audit follow-up to 37435b7, found by re-reviewing the shipped screenshots: 1) Bidi: diagrams are consumed as <img> (no inherited page direction), so mixed Arabic+Latin labels rendered LTR and split the number from its unit — 'محرك 500kW' showed as '500 محركkW'. Every label/title now carries direction=rtl + unicode-bidi=isolate with a start<->end anchor flip that preserves the exact scored box (Chromium-verified). 2) Placement hole: clampCandidateX could push a label ONTO its own symbol because placeLabels exempted the label's own body from collision scoring. Self-bodies now count. 3) Dense-row escapes: side candidates now include up/down diagonals and below/above spots get a depth ladder (3 tiers x 3 shifts) — a packed bottom row ('فيوز 100A' boxed in by neighbors' bodies/labels) always finds a zero-collision spot instead of falling onto fan-out wires. 4) sheetSize side band scales with the LONGEST label instead of a fixed 96px, so full-wid…82358cc -
fix(sld): zero-overlap label placement — labels sit BESIDE their element
Z UserVisual audit found labels painted on wires/symbols and colliding with the sheet title (G1 label vs title, 66/11kV across the breaker, Main 11kV cut by its feed wire). - placeLabels(): every label is scored against title/bodies/labels/wires/ sheet edges; first zero-collision spot wins (right > left > below > above; busbars prefer left). Deterministic least-collision fallback. - Busbar fan-out dots stagger LEFTWARD so connection dots stay ON the bar. - sheetSize() reserves a side band (96px) when labels exist; geometry shifts half-band right so left-side labels never clip. - Over-long titles squeeze via textLength instead of spilling over row 0. - chat-render: append &v=3 to SLD URLs to bust stale immutable caches. - New regression suite parses the rendered SVG and asserts every label is clear of wires, symbols, other labels and the title (dark/light/dense).37435b7 -
feat(sld): draw single-line diagrams — spec-in, SVG-out, model text never becomes markup
Z UserPhase 1 of the electrical-diagram capability, architecture ported from abduznik/electrical-schematics-skill (grid layout, orthogonal routing, generate→audit→fix discipline) onto our Node runtime: - api/lib/sld/: types (grid→px placement, terminals), symbols (12 ETAP power elements, dark/light themes), lint (bounds/overlap/refs/grid), render (deterministic SVG, monotonic 3-segment routing with per-source fan-out columns, gap-clamped turns) - api/diagrams-router.ts: GET image/svg+xml (lint-fail = 422 + findings, immutable cache), POST JSON (svg + findings + canonical url) — public, read-only, zero storage, spec capped at 4k chars/40 elements - chat: sldSkill (Ar+En) injected THINKING-mode only — instant untouched; the model emits a sld JSON fence, never pixels; chat-render synthesizes the ONLY allowed img: same-origin /api/diagrams/... whose SVG comes exclusively from our linted renderer — malformed fences fall back to the escaped code block (streaming-safe) - tests: 1…ccfdb3c