@atlasnomos/atlas 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/atlas.js CHANGED
@@ -8,10 +8,8 @@ const path = require('path');
8
8
  const { ErrorHandler } = require('./src/core/ErrorHandler');
9
9
 
10
10
  // 0. Entry Point Hardening (Anti-Bypass)
11
- if (require.main !== module) {
12
- console.error('⛔ SECURITY VIOLATION: ATLAS Kernel must be executed directly, not required as a module.');
13
- process.exit(1);
14
- }
11
+ const { validateEntryPoint } = require('./src/kernel/boot/BootGuard');
12
+ validateEntryPoint();
15
13
 
16
14
  // 1. Load Env & Config
17
15
  // Priority 1: CWD .env (Project specific)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlasnomos/atlas",
3
- "version": "1.1.2",
3
+ "version": "1.1.3",
4
4
  "description": "Production-grade AI governance kernel for autonomous agents with fail-closed security and cryptographic audit trails",
5
5
  "main": "atlas.js",
6
6
  "bin": {
@@ -25,7 +25,8 @@ const { panic } = require('./HardKill');
25
25
  * All paths are relative to the atlas root directory.
26
26
  */
27
27
  const AUTHORIZED_ENTRY_POINTS = Object.freeze([
28
- 'atlas.js'
28
+ 'atlas.js',
29
+ 'atlas' // Supported for NPM global wrapper
29
30
  ]);
30
31
 
31
32
  // ═══════════════════════════════════════════════════════════════
@@ -56,11 +57,14 @@ function validateEntryPoint() {
56
57
  const expectedPath = path.join(atlasRoot, entryFilename);
57
58
 
58
59
  // Normalize paths for comparison (handle Windows backslashes)
59
- if (path.resolve(mainModule.filename) !== expectedPath) {
60
- panic('BOOT_GUARD: Entry point path mismatch', {
60
+ const normalizedActual = path.resolve(mainModule.filename);
61
+ const isUnderRoot = normalizedActual.startsWith(atlasRoot);
62
+
63
+ if (!isUnderRoot) {
64
+ panic('BOOT_GUARD: Entry point out of bounds', {
61
65
  actual: mainModule.filename,
62
- expected: expectedPath,
63
- reason: 'Entry point must be in the kernel root directory'
66
+ expectedPrefix: atlasRoot,
67
+ reason: 'Entry point must be within the kernel root directory'
64
68
  });
65
69
  return false;
66
70
  }