Hidden Assumptions in directus
13 assumptions this code never checks · 5 critical · spanning Environment, Contract, Scale, Temporal, Resource, Domain
Every codebase relies on things it never checks. Most of them are routine. CodeSea looked at directus/directus and picked out the few most likely to cause trouble. The full list is just below.
Most of what this code assumes is routine. These 3 are the ones most likely to cause trouble here. The rest are minor; they're under "Show everything".
If the api/cli module is missing, incompatible, or expects different arguments, the CLI silently fails with unclear error messages or crashes after showing update check
If Node.js version format changes (e.g., 'v22.0.0' or '22.0.0-rc1'), +nodeVersion.split('.')[0] could return NaN, causing silent version check bypass and potential runtime failures
Changing primaryKey types (e.g., '123' to 123) can cause the useItem composable to not reload data, leaving stale item data in the interface while edits apply to the wrong record
Show everything (10 more)
Query URLs longer than 8192 characters will cause HTTP 414/431 errors, and the SEARCH method fallback will always be available and accepted by the server
If this fails: If the server doesn't support SEARCH method or has different URL length limits (some proxies limit to 2048), the automatic fallback fails and complex queries become impossible to execute
app/src/composables/use-item/index.ts:MAX_QUERY_URL_LENGTH
The @ai-sdk/devtools package will be available in the node_modules when AI_DEVTOOLS_ENABLED=true, and localhost:4983 will always be available for the DevTools server
If this fails: If the DevTools package is missing or localhost:4983 is in use, AI debugging fails silently with just a warning, potentially blocking AI development workflow
api/src/ai/devtools/index.ts:doDevToolsInit
The devToolsInitPromise will complete before any AI operations need the middleware, and multiple concurrent calls to initAIDevTools won't create race conditions
If this fails: If AI operations start before initialization completes, they proceed without debugging middleware, making debugging intermittent and unreliable during system startup
api/src/ai/devtools/index.ts:initAIDevTools
The layout.setup function will return a valid Vue composition API object and won't throw exceptions during component initialization
If this fails: If a layout's setup function throws errors or returns invalid objects, the entire layout system crashes with cryptic Vue errors rather than graceful degradation
packages/composables/src/use-layout.ts:createLayoutWrapper
All components using createLayoutWrapper will only emit updates for properties that are in WRITABLE_PROPS array ['selection', 'layoutOptions', 'layoutQuery']
If this fails: If a layout tries to update non-writable props, the emit will be ignored silently, causing UI state to become inconsistent with component internal state
packages/composables/src/use-layout.ts:isWritableProp
The inquirer.prompt() will always resolve with all required properties (type, name, language, install) and EXTENSION_TYPES/EXTENSION_LANGUAGES constants are properly defined
If this fails: If inquirer is interrupted or constants are undefined, the create() function receives malformed parameters, causing extension scaffolding to fail with unclear errors
packages/create-directus-extension/lib/index.js:run
The target directory has write permissions, sufficient disk space for Directus installation, and the filesystem supports creating nested directories (uploads, extensions)
If this fails: Partial installation if disk space runs out mid-installation, or permission errors creating subdirectories after the main directory exists, leaving project in broken state
packages/create-directus-project/lib/index.js:create
The npm/yarn package manager is available in PATH and can successfully install Directus dependencies without network issues or registry authentication problems
If this fails: If package installation fails due to network, registry, or auth issues, the project folder exists but is non-functional, with no cleanup of partial state
packages/create-directus-project/lib/index.js:create
Terminal width is sufficient to display the animated bunny spinner (at least numOfSpaces + 2 characters wide) and supports Unicode emoji
If this fails: Spinner animation breaks or displays incorrectly on narrow terminals or systems without Unicode support, potentially causing terminal display corruption
packages/create-directus-project/lib/index.js:bunnyFrames
Directus will always require exactly Node.js version 22 major, hardcoded as const expectedMajor = 22, and this version requirement won't need updates for patch releases or security updates
If this fails: When Directus adds support for Node.js 24 or requires 22.5+ for security fixes, the version check becomes a false blocker, preventing valid installations
packages/create-directus-project/lib/check-requirements.js:expectedMajor
See the full structural analysis of directus: the pipeline, data models, and system behavior that put these assumptions in context.
Full analysis of directus/directus →Compare directus
Frequently Asked Questions
What does directus assume that could break in production?
The one most likely to cause trouble: The @directus/api/cli/run.js module exists and exports executable code that can handle the current command line arguments without the CLI wrapper passing any context If this fails, If the api/cli module is missing, incompatible, or expects different arguments, the CLI silently fails with unclear error messages or crashes after showing update check
How many hidden assumptions does directus have?
CodeSea found 13 assumptions directus relies on but never validates, 5 of them critical, spanning Environment, Contract, Scale, Temporal, Resource, Domain. Most are routine — the analysis flags the two or three most likely to actually bite.
What is a hidden assumption?
Something the code depends on but never checks: a data shape, an ordering, an environment condition, a scale limit, or a contract with another service. It holds until the world it runs in changes, then fails silently.