@principles/host-runtime 2.2.1 → 2.2.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.
@@ -3,6 +3,9 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  import Database from 'better-sqlite3';
5
5
  import { applyTrajectorySchemaBase, migrateLegacyGfiSchema, sanitizeToolParams, sanitizeValue, } from '@principles/core/runtime-v2';
6
+ // PRI-1135: the canonical column declaration lives with the DDL owner. Import
7
+ // the subpath directly so the public runtime-v2 barrel surface stays unchanged.
8
+ import { TRAJECTORY_REQUIRED_COLUMNS } from '@principles/core/runtime-v2/trajectory-schema';
6
9
  const MAX_PREVIEW = 500;
7
10
  function isRecord(value) {
8
11
  return typeof value === 'object' && value !== null && !Array.isArray(value);
@@ -152,11 +155,8 @@ export function deriveProductionCorrectionPainIdentity(fields) {
152
155
  const digest = createHash('sha256').update(canonical).digest('hex');
153
156
  return { eventId: `host_${digest}`, painId: `pain_host_${digest}` };
154
157
  }
155
- const REQUIRED_COLUMNS = {
156
- sessions: { session_id: 'TEXT', started_at: 'TEXT', updated_at: 'TEXT' },
157
- tool_calls: { session_id: 'TEXT', tool_name: 'TEXT', outcome: 'TEXT', duration_ms: 'INTEGER', exit_code: 'INTEGER', error_type: 'TEXT', error_message: 'TEXT', params_json: 'TEXT', result_preview: 'TEXT', created_at: 'TEXT', project_dir: 'TEXT' },
158
- pain_events: { session_id: 'TEXT', source: 'TEXT', score: 'REAL', reason: 'TEXT', severity: 'TEXT', origin: 'TEXT', confidence: 'REAL', text: 'TEXT', canonical_pain_id: 'TEXT', runtime_task_id: 'TEXT', host_kind: 'TEXT', created_at: 'TEXT' },
159
- };
158
+ // PRI-1135: the canonical required-column declaration now lives in core
159
+ // (TRAJECTORY_REQUIRED_COLUMNS); this module keeps no second copy.
160
160
  function pragmaField(row, key) {
161
161
  return isRecord(row) && Object.hasOwn(row, key) ? Object.getOwnPropertyDescriptor(row, key)?.value : undefined;
162
162
  }
@@ -176,7 +176,7 @@ function hasCanonicalIndexPredicate(db) {
176
176
  return whereIndex >= 0 && normalized.slice(whereIndex + 7) === 'CANONICAL_PAIN_ID IS NOT NULL';
177
177
  }
178
178
  function hasCanonicalSchema(db) {
179
- for (const [table, required] of Object.entries(REQUIRED_COLUMNS)) {
179
+ for (const [table, required] of Object.entries(TRAJECTORY_REQUIRED_COLUMNS)) {
180
180
  const rows = db.prepare(`PRAGMA table_info(${table})`).all();
181
181
  const actual = new Map();
182
182
  for (const row of rows) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/host-runtime",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Shared host-neutral orchestration for Principles Disciple MVP-Core hook paths.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,7 +31,7 @@
31
31
  "lint": "eslint \"src/**/*.ts\""
32
32
  },
33
33
  "dependencies": {
34
- "@principles/core": "^4.1.0",
34
+ "@principles/core": "^4.2.0",
35
35
  "@principles/install-layout": "^0.4.0",
36
36
  "better-sqlite3": "^13.0.3",
37
37
  "js-yaml": "^5.4.3"
@@ -49,5 +49,5 @@
49
49
  "url": "git+https://github.com/csuzngjh/principles.git"
50
50
  },
51
51
  "license": "Apache-2.0",
52
- "gitHead": "e2f66fab6d7e1830c6552c73ad9b3292996c254f"
52
+ "gitHead": "3c04ff93abbde31dcca25c8ad0809d00807b5015"
53
53
  }