fraim 2.0.360-next.1 → 2.0.360-next.2

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.
@@ -288,10 +288,21 @@ async function verifyCapabilityDelivery(action, input, options) {
288
288
  const { resolvePackHome } = load('cli/utils/pack-home');
289
289
  const manager = resolvePackHome('manager', { migrateLegacy: false });
290
290
  const org = resolvePackHome('org', { migrateLegacy: false });
291
+ const consumedLocalFiles = new Set();
291
292
  const resolver = new LocalRegistryResolver({ workspaceRoot: options.projectPath,
292
293
  managerLocalRoot: manager.contentRoot, managerCacheRoot: manager.contentRoot, orgCacheRoot: org.contentRoot,
293
294
  remoteContentResolver: async () => { throw new Error('capability-not-available-locally'); },
294
- onLocalDependency: (file, kind, content) => kind === 'directory' ? snapshotDirectory(file) : snapshot(file, content),
295
+ onLocalDependency: (file, kind, content) => {
296
+ if (kind === 'directory')
297
+ snapshotDirectory(file);
298
+ else {
299
+ snapshot(file, content);
300
+ // A content-bearing callback records an actual read; existence
301
+ // probes and absent overlays must not become publication inputs.
302
+ if (content !== undefined)
303
+ consumedLocalFiles.add(node_path_1.default.resolve(file));
304
+ }
305
+ },
295
306
  });
296
307
  const originalResolve = resolver.resolveFile.bind(resolver);
297
308
  const snapshots = new Map();
@@ -486,6 +497,18 @@ async function verifyCapabilityDelivery(action, input, options) {
486
497
  }
487
498
  }
488
499
  resolver.resolveFile = originalResolve;
500
+ if (shared) {
501
+ // Inheritance resolves raw parents internally, bypassing the public
502
+ // resolveFile interceptor. Include the Project rule bytes it consumed
503
+ // in both merged-commit and current-remote publication verification.
504
+ const projectRules = node_path_1.default.join(options.projectPath, 'fraim/personalized-employee/rules');
505
+ for (const file of consumedLocalFiles) {
506
+ const relative = node_path_1.default.relative(projectRules, file);
507
+ if (!relative || relative === '..' || relative.startsWith('..' + node_path_1.default.sep) || node_path_1.default.isAbsolute(relative))
508
+ continue;
509
+ sharedCallers.push({ file, expectedHash: snapshots.get(file).sha256 });
510
+ }
511
+ }
489
512
  if (!reachable || (0, proposal_queue_1.hashContent)(node_fs_1.default.readFileSync(target, 'utf8')) !== localHash)
490
513
  return { published: false, reference: target, contentHash, reachable: false };
491
514
  const localFiles = [...snapshots.values()].sort((a, b) => a.file.localeCompare(b.file));
@@ -1335,7 +1335,7 @@ class FraimDbService {
1335
1335
  /** Keep the earliest observed start per execution before grouping into time buckets. */
1336
1336
  distinctJobStartStages() {
1337
1337
  return [
1338
- { $sort: { createdAt: 1, _id: 1 } },
1338
+ { $sort: { createdAt: 1 } },
1339
1339
  { $group: {
1340
1340
  _id: { $cond: [
1341
1341
  { $and: [{ $eq: ['$type', 'job'] }, { $ne: [{ $ifNull: ['$jobId', ''] }, ''] }] },
@@ -1,44 +1,8 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  Object.defineProperty(exports, "__esModule", { value: true });
36
3
  exports.requestLogger = requestLogger;
37
4
  const crypto_1 = require("crypto");
38
5
  const redact_secrets_1 = require("../core/utils/redact-secrets");
39
- const fs = __importStar(require("fs"));
40
- const path = __importStar(require("path"));
41
- const LOG_FILE = path.join(process.cwd(), 'server-direct.log');
42
6
  function getBodyForLogging(req) {
43
7
  if (req.path === '/api/ai-hub/brand' && req.body && typeof req.body === 'object') {
44
8
  const body = { ...req.body };
@@ -82,16 +46,8 @@ function requestLogger(req, res, next) {
82
46
  }
83
47
  }
84
48
  const logEntry = (msg) => {
85
- const timestamp = new Date().toISOString();
86
- const entry = `[${timestamp}] ${msg}\n`;
87
- try {
88
- fs.appendFileSync(LOG_FILE, entry);
89
- }
90
- catch (e) {
91
- console.error('Failed to write to log file:', e);
92
- }
93
49
  if (msg.includes('END') && msg.includes(' 400')) {
94
- console.error(msg); // Still log errors to console
50
+ console.error(msg);
95
51
  }
96
52
  else {
97
53
  console.info(msg);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fraim",
3
- "version": "2.0.360-next.1",
3
+ "version": "2.0.360-next.2",
4
4
  "description": "FRAIM core CLI and MCP package.",
5
5
  "main": "index.js",
6
6
  "bin": {