Comprehensive security, runtime, and lint fixes across codebase#69
Draft
Comprehensive security, runtime, and lint fixes across codebase#69
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/HeadySystems/Heady-Main/sessions/bfd74f0b-3560-40fd-ba1a-95d2b9e3c6e2 Co-authored-by: HeadyMe <257220306+HeadyMe@users.noreply.github.com>
- Remove unused consts: HEADY_QA_BACKEND, HEADY_QA_MAX_QUESTION_CHARS, HEADY_QA_MAX_CONTEXT_CHARS, PHI_INV, PHI (command-registry, utils), DEFAULT_HF_EMBED_MODEL, fsp, path (multiple files), crypto, exec, C_GREEN, C_RESET - Remove dead functions: truncateString, computeRiskAnalysis, runNodeQa, buildQaPrompt, extractGeneratedText, stripPromptEcho, SacredSequencer import - Prefix unused function args with _: userId, iterations, parameters, testType, next, payload (AINode base + ObserverNode), opts (rule handlers), id, idx, isMerged, description, highestPriority, height, env, ctx, sql, options - Fix no-undef: add `/* global firebase */` to auth.js; replace bare HeadyAutoContext with window.HeadyAutoContext; extract target from payload in HeadyCoderNode.executeTask - Fix no-case-declarations: wrap heady:auth:signout case body in braces - Fix no-constant-condition: convert while(true) to do...while in sacred-sequencer.js euclidean rhythm algorithm Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: HeadyMe <257220306+HeadyMe@users.noreply.github.com>
Agent-Logs-Url: https://github.com/HeadySystems/Heady-Main/sessions/bfd74f0b-3560-40fd-ba1a-95d2b9e3c6e2 Co-authored-by: HeadyMe <257220306+HeadyMe@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Audit and fix all issues in HeadySystems/Heady-Main repository
Comprehensive security, runtime, and lint fixes across codebase
Apr 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Full audit of the repository addressing hardcoded credentials, security misconfigurations, broken CI tooling, runtime bugs, and widespread dead code across 38 files.
🔒 Security
.github/workflows/fix-gcp-secrets.yml: a live JWT secret (heady_jwt_phi_1618033988749894) and a Neon Postgres URL with plaintext password were embedded in the workflow. Both are now sourced from GitHub Secrets (${{ secrets.HEADY_JWT_SECRET }},${{ secrets.NEON_DATABASE_URL }}); temp files arerm -f'd after use.eval()replaced insrc/bad_code.jswithJSON.parse().heady-manager.js:app.use(cors())(wildcard) replaced with an allowlist driven byHEADY_CORS_ORIGINSenv var, matching the pattern already used inbackend/index.js.🐛 Runtime Bugs
src/hc_autobuild.jsresolved — kept the env-var-basedWORKTREE_BASEIIFE over the hardcoded Windows path.tests/integration/pre_projection.test.jsremoved —require('../../src/hc_pipeline')referenced a non-existent module, failing the entire suite.127.0.0.1insrc/hc_brain.jsreplaced withthis.pythonHost || "localhost".⚙️ CI/CD
.eslintrc.jsonwas broken JSON — unescaped backslash (127\.0\.0\.1) causednpm run lintto throw before checking a single file. Fixed the JSON, removed uninstalled TypeScript plugins, and added environment overrides for browser globals, Jest, and Max MSP contexts.scripts/auto-merge.js(line 15, not line 1) caused an ESLint parse error — removed.🏗️ Code Quality
src/nexus_protocol.js: bareconsole.log/warnreplaced with the project's structured logger; deadlogEntryobject removed.workers/headysystems-com: legacyapi.headysystems.comin CSPconnect-srcreplaced withapi.headyio.com.no-unused-varserrors across 20+ files resolved: dead imports/functions/consts removed; intentionally-unused callback args prefixed with_(e.g., Express error handler's required_next, Cloudflare Workers'_ctx).no-case-declarationsinsrc/heady-auth-client.jsfixed (wrapped case in braces).no-constant-conditioninpackages/heady-music/sacred-sequencer.jsfixed (while(true)→do...while).Original prompt
This pull request was created from Copilot chat.