Skip to content

refactor(security,config): split oversized files using dot-naming con…#13182

Merged
quotentiroler merged 1 commit intomainfrom
refactor/wave1-split-oversized-files
Feb 10, 2026
Merged

refactor(security,config): split oversized files using dot-naming con…#13182
quotentiroler merged 1 commit intomainfrom
refactor/wave1-split-oversized-files

Conversation

@quotentiroler
Copy link
Copy Markdown
Contributor

@quotentiroler quotentiroler commented Feb 10, 2026

…vention

  • audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)

  • schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)

  • Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

Greptile Overview

Greptile Summary

This PR splits two oversized modules into smaller dot-named files:

  • src/security/audit-extra.ts is converted into a small re-export barrel, the implementation moved into src/security/audit-extra.sync.ts (config-only checks) and src/security/audit-extra.async.ts (I/O-based checks).
  • src/config/schema.ts has its large UI-hints metadata extracted into src/config/schema.field-metadata.ts while keeping buildConfigSchema() behavior in schema.ts.

Overall this is a structural refactor intended to preserve behavior while improving maintainability and aligning with the repo’s dot-suffix module convention.

Confidence Score: 4/5

  • Mostly safe refactor, with one correctness issue to address
  • The changes are largely file moves/re-exports, but collectPluginsTrustFindings now reads from process.env instead of the injected env used by the audit runner, making outputs environment-dependent and breaking deterministic tests/configured behavior.
  • src/security/audit-extra.async.ts

@openclaw-barnacle openclaw-barnacle bot added the maintainer Maintainer-authored PR label Feb 10, 2026
Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +222 to +230

const allow = params.cfg.plugins?.allow;
const allowConfigured = Array.isArray(allow) && allow.length > 0;
if (!allowConfigured) {
const hasString = (value: unknown) => typeof value === "string" && value.trim().length > 0;
const hasAccountStringKey = (account: unknown, key: string) =>
Boolean(
account &&
typeof account === "object" &&
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.

Env leakage breaks tests

collectPluginsTrustFindings reads tokens from process.env (e.g., DISCORD_BOT_TOKEN, TELEGRAM_BOT_TOKEN, SLACK_BOT_TOKEN, SLACK_APP_TOKEN) instead of the env passed through the audit pipeline. This makes audit results (and any unit tests that inject env) non-deterministic and environment-dependent. Use the injected env (add env to params like other collectors) rather than process.env here.

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/security/audit-extra.async.ts
Line: 222:230

Comment:
**Env leakage breaks tests**

`collectPluginsTrustFindings` reads tokens from `process.env` (e.g., `DISCORD_BOT_TOKEN`, `TELEGRAM_BOT_TOKEN`, `SLACK_BOT_TOKEN`, `SLACK_APP_TOKEN`) instead of the `env` passed through the audit pipeline. This makes audit results (and any unit tests that inject `env`) non-deterministic and environment-dependent. Use the injected env (add `env` to params like other collectors) rather than `process.env` here.

How can I resolve this? If you propose a fix, please make it concise.

…vention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)

- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)

- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan
@quotentiroler quotentiroler force-pushed the refactor/wave1-split-oversized-files branch from 4579a64 to 1e2f933 Compare February 10, 2026 06:15
@quotentiroler quotentiroler merged commit f17c978 into main Feb 10, 2026
19 of 20 checks passed
@quotentiroler quotentiroler deleted the refactor/wave1-split-oversized-files branch February 10, 2026 06:22
vignesh07 pushed a commit that referenced this pull request Feb 10, 2026
refactor(security,config): split oversized files using dot-naming convention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)
- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)
- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

PR #13182
YanHaidao added a commit to YanHaidao/clawdbot that referenced this pull request Feb 10, 2026
* 'main' of github.com:YanHaidao/clawdbot: (94 commits)
  fix(auto-reply): prevent sender spoofing in group prompts
  Discord: add exec approval cleanup option (openclaw#13205)
  CI: extend stale timelines to be contributor-friendly (openclaw#13209)
  fix: enforce Discord agent component DM auth (openclaw#11254) (thanks @thedudeabidesai)
  refactor(security,config): split oversized files (openclaw#13182)
  Commands: add commands.allowFrom config
  CI: configure stale automation
  fix(signal): enforce mention gating for group messages (openclaw#13124)
  fix(ui): prioritize displayName over label in webchat session picker (openclaw#13108)
  Chore: add testflight auto-response
  Docker: include A2UI sources for bundle (openclaw#13114)
  fix: unify session maintenance and cron run pruning (openclaw#13083)
  docs: expand vulnerability reporting guidelines in SECURITY.md
  docs: add vulnerability reporting guidelines to CONTRIBUTING.md
  refactor: consolidate fetchWithTimeout into shared utility
  fix(memory): default batch embeddings to off
  Improve code analyzer for independent packages, CI: only run release-check on push to main
  fix(tools): correct Grok response parsing for xAI Responses API (openclaw#13049)
  chore(deps): update dependencies, remove hono pinning
  Update contributing, deduplicate more functions
  ...
Hansen1018 pushed a commit to Hansen1018/openclaw that referenced this pull request Feb 10, 2026
refactor(security,config): split oversized files using dot-naming convention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)
- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)
- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

PR openclaw#13182
michaelleone pushed a commit to michaelleone/openclaw that referenced this pull request Feb 11, 2026
refactor(security,config): split oversized files using dot-naming convention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)
- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)
- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

PR openclaw#13182
@HenryLoenwind
Copy link
Copy Markdown
Contributor

HenryLoenwind commented Feb 11, 2026

Why did this one get merged? schema.field-metadata.ts is unused duplicate data and there's a temp file with AI thinking in it...

Please, guys, don't merge your own AI's slob without even looking at it.

skyhawk14 pushed a commit to skyhawk14/openclaw that referenced this pull request Feb 13, 2026
refactor(security,config): split oversized files using dot-naming convention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)
- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)
- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

PR openclaw#13182
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 1, 2026
refactor(security,config): split oversized files using dot-naming convention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)
- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)
- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

PR openclaw#13182

(cherry picked from commit f17c978)
hughdidit pushed a commit to hughdidit/DAISy-Agency that referenced this pull request Mar 3, 2026
refactor(security,config): split oversized files using dot-naming convention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)
- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)
- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

PR openclaw#13182

(cherry picked from commit f17c978)

# Conflicts:
#	src/security/audit-extra.ts
zooqueen pushed a commit to hanzoai/bot that referenced this pull request Mar 6, 2026
refactor(security,config): split oversized files using dot-naming convention

- audit-extra.ts (1,199 LOC) -> barrel (31) + sync (559) + async (668)
- schema.ts (1,114 LOC) -> schema (353) + field-metadata (729)
- Add tmp-refactoring-strategy.md documenting Wave 1-4 plan

PR openclaw#13182
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants