@atlasnomos/atlas 10.0.2 → 10.0.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/package.json
CHANGED
|
@@ -230,16 +230,31 @@ class BuildCommand {
|
|
|
230
230
|
|
|
231
231
|
console.log('✅ Integrity Verified. Persisting Artifacts...');
|
|
232
232
|
|
|
233
|
-
// CONFIG:
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
// CONFIG: Output to OUTPUTS/builds/<session>/ structure
|
|
234
|
+
const sessionId = session.getId();
|
|
235
|
+
const buildTimestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
236
|
+
const buildFolderName = `${buildTimestamp}_${sessionId.substring(0, 8)}`;
|
|
237
|
+
const outputDir = path.join(process.cwd(), 'OUTPUTS', 'builds', buildFolderName);
|
|
237
238
|
|
|
238
239
|
if (!fs.existsSync(outputDir)) {
|
|
239
240
|
fs.mkdirSync(outputDir, { recursive: true });
|
|
240
|
-
console.log(` + Created
|
|
241
|
+
console.log(` + Created build directory: OUTPUTS/builds/${buildFolderName}/`);
|
|
241
242
|
}
|
|
242
243
|
|
|
244
|
+
// Create build manifest with metadata
|
|
245
|
+
const manifest = {
|
|
246
|
+
build_id: buildFolderName,
|
|
247
|
+
session_id: sessionId,
|
|
248
|
+
goal,
|
|
249
|
+
goal_hash: goalHash,
|
|
250
|
+
artifact_hash: artifactHash,
|
|
251
|
+
timestamp: new Date().toISOString(),
|
|
252
|
+
attested: commitApproval.attested || false,
|
|
253
|
+
tier: this.tierManager.getTier(),
|
|
254
|
+
user: process.env.USERNAME || 'operator',
|
|
255
|
+
files: []
|
|
256
|
+
};
|
|
257
|
+
|
|
243
258
|
// START TRANSACTION (Fix 7)
|
|
244
259
|
const tx = getGlobalTransaction();
|
|
245
260
|
// In v1 we rely on global transaction state (single build per process)
|
|
@@ -261,6 +276,7 @@ class BuildCommand {
|
|
|
261
276
|
const exists = fs.existsSync(filePath);
|
|
262
277
|
|
|
263
278
|
fs.writeFileSync(filePath, file.content);
|
|
279
|
+
manifest.files.push(file.path);
|
|
264
280
|
console.log(` + ${path.relative(process.cwd(), filePath)}`);
|
|
265
281
|
|
|
266
282
|
// Register rollback
|
|
@@ -285,6 +301,7 @@ class BuildCommand {
|
|
|
285
301
|
|
|
286
302
|
const exists = fs.existsSync(outputPath);
|
|
287
303
|
fs.writeFileSync(outputPath, content);
|
|
304
|
+
manifest.files.push(`output.${ext}`);
|
|
288
305
|
console.log(` + ${path.relative(process.cwd(), outputPath)}`);
|
|
289
306
|
|
|
290
307
|
// Register rollback for single file output
|
|
@@ -296,6 +313,11 @@ class BuildCommand {
|
|
|
296
313
|
});
|
|
297
314
|
}
|
|
298
315
|
|
|
316
|
+
// Write manifest.json with build metadata
|
|
317
|
+
const manifestPath = path.join(outputDir, 'manifest.json');
|
|
318
|
+
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
|
319
|
+
console.log(` + ${path.relative(process.cwd(), manifestPath)}`);
|
|
320
|
+
|
|
299
321
|
// If we get here, everything wrote successfully
|
|
300
322
|
tx.commitAll();
|
|
301
323
|
|
|
@@ -270,6 +270,26 @@ class KernelBootstrap {
|
|
|
270
270
|
console.log(` ► Automation Registry SKIPPED (Mode: ${currentMode.id})`);
|
|
271
271
|
}
|
|
272
272
|
|
|
273
|
+
// ═══════════════════════════════════════════════════════════════
|
|
274
|
+
// 3.4 Initialize OUTPUTS Directory Structure
|
|
275
|
+
// Centralized location for audit logs, traces, builds, and costs
|
|
276
|
+
// ═══════════════════════════════════════════════════════════════
|
|
277
|
+
const outputsRoot = path.join(process.cwd(), 'OUTPUTS');
|
|
278
|
+
const outputDirs = [
|
|
279
|
+
outputsRoot,
|
|
280
|
+
path.join(outputsRoot, 'audit'),
|
|
281
|
+
path.join(outputsRoot, 'traces'),
|
|
282
|
+
path.join(outputsRoot, 'builds'),
|
|
283
|
+
path.join(outputsRoot, 'costs'),
|
|
284
|
+
path.join(outputsRoot, 'panic')
|
|
285
|
+
];
|
|
286
|
+
for (const dir of outputDirs) {
|
|
287
|
+
if (!fs.existsSync(dir)) {
|
|
288
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
console.log(' ✓ OUTPUTS Directory: Initialized');
|
|
292
|
+
|
|
273
293
|
// ═══════════════════════════════════════════════════════════════
|
|
274
294
|
// 3.5 Initialize Governance Trackers (ALL TIERS)
|
|
275
295
|
// DEV Mode Honesty: Trackers must be wired regardless of tier
|
|
@@ -21,7 +21,7 @@ const AUDIT_RESERVATION_KEY = Symbol('ATLAS_AUDIT_RESERVATION');
|
|
|
21
21
|
|
|
22
22
|
class AuditSink {
|
|
23
23
|
constructor(config = {}) {
|
|
24
|
-
this.logPath = config.logPath || path.join(process.cwd(), '
|
|
24
|
+
this.logPath = config.logPath || path.join(process.cwd(), 'OUTPUTS', 'audit', 'audit.jsonl');
|
|
25
25
|
// NOMOS-PLATFORM BRIDGE: Evidence Path
|
|
26
26
|
// The Platform (Next.js) expects events at atlas/data/evidence.jsonl
|
|
27
27
|
// When running from 'atlas' dir, process.cwd() is '.../ATLAS NOMOS/atlas'
|
|
@@ -27,7 +27,7 @@ const SentinelInterface = require('../kernel/constitution/SentinelInterface');
|
|
|
27
27
|
// Hash-chained audit log for PROD events
|
|
28
28
|
let HashChainedLog = null;
|
|
29
29
|
let _costEventLog = null;
|
|
30
|
-
const COST_EVENT_LOG_PATH = path.join(process.cwd(), '
|
|
30
|
+
const COST_EVENT_LOG_PATH = path.join(process.cwd(), 'OUTPUTS', 'costs', 'cost_events.chainlog');
|
|
31
31
|
|
|
32
32
|
function getCostEventLog() {
|
|
33
33
|
if (!HashChainedLog) {
|
|
@@ -57,7 +57,7 @@ class CostTracker {
|
|
|
57
57
|
this.enabled = true;
|
|
58
58
|
this.configPath = path.resolve(process.cwd(), 'atlas.config.json');
|
|
59
59
|
this.budget = this._loadConfig() || config.budget || { daily_limit_usd: 100, monthly_limit_usd: 2000, alert_threshold: 0.8 };
|
|
60
|
-
this.logFile = config.log_file || '
|
|
60
|
+
this.logFile = config.log_file || 'OUTPUTS/costs/usage.jsonl';
|
|
61
61
|
|
|
62
62
|
this.usage = {
|
|
63
63
|
today: 0,
|