create-principles-disciple 1.150.1 → 1.150.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.
Files changed (75) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/dist/ingestion/ingestion.d.ts +9 -7
  3. package/codex-adapter/dist/ingestion/ingestion.js +68 -144
  4. package/codex-adapter/dist/ingestion/transcript-decoder.d.ts +35 -44
  5. package/codex-adapter/dist/ingestion/transcript-decoder.js +23 -84
  6. package/codex-adapter/dist/ingestion/transcript-source.d.ts +29 -0
  7. package/codex-adapter/dist/ingestion/transcript-source.js +65 -0
  8. package/codex-adapter/dist/pd-hook.d.ts +5 -0
  9. package/codex-adapter/dist/pd-hook.js +8 -1
  10. package/codex-adapter/package.json +1 -1
  11. package/console/dist/server/routes/examiner-eligibility.d.ts +73 -0
  12. package/console/dist/server/routes/examiner-eligibility.js +326 -0
  13. package/console/dist/server/routes/examiner.js +66 -8
  14. package/console/dist/web/assets/app.css +40 -0
  15. package/console/dist/web/assets/app.js +30 -30
  16. package/core/dist/runtime/activation/adaptive-selection-output.d.ts +35 -0
  17. package/core/dist/runtime/activation/adaptive-selection-output.d.ts.map +1 -0
  18. package/core/dist/runtime/activation/adaptive-selection-output.js +38 -0
  19. package/core/dist/runtime/activation/adaptive-selection-output.js.map +1 -0
  20. package/core/dist/runtime/adapter/artificer-l2-adapter.d.ts.map +1 -1
  21. package/core/dist/runtime/adapter/artificer-l2-adapter.js +89 -27
  22. package/core/dist/runtime/adapter/artificer-l2-adapter.js.map +1 -1
  23. package/core/dist/runtime/adapter/context-budget.d.ts +49 -0
  24. package/core/dist/runtime/adapter/context-budget.d.ts.map +1 -0
  25. package/core/dist/runtime/adapter/context-budget.js +127 -0
  26. package/core/dist/runtime/adapter/context-budget.js.map +1 -0
  27. package/core/dist/runtime/adapter/output-schema-registry.d.ts.map +1 -1
  28. package/core/dist/runtime/adapter/output-schema-registry.js +7 -0
  29. package/core/dist/runtime/adapter/output-schema-registry.js.map +1 -1
  30. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts +30 -7
  31. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  32. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +467 -206
  33. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
  34. package/core/dist/runtime/config/pd-config-effective.d.ts.map +1 -1
  35. package/core/dist/runtime/config/pd-config-effective.js +5 -2
  36. package/core/dist/runtime/config/pd-config-effective.js.map +1 -1
  37. package/core/dist/telemetry-event.d.ts +2 -2
  38. package/core/dist/telemetry-event.d.ts.map +1 -1
  39. package/core/dist/telemetry-event.js +5 -0
  40. package/core/dist/telemetry-event.js.map +1 -1
  41. package/core/package.json +1 -1
  42. package/dist/installers/codex-host-installer.d.ts.map +1 -1
  43. package/dist/installers/codex-host-installer.js +20 -0
  44. package/dist/installers/codex-host-installer.js.map +1 -1
  45. package/host-runtime/dist/adaptive-priority-provider.d.ts +7 -0
  46. package/host-runtime/dist/adaptive-priority-provider.js +34 -2
  47. package/host-runtime/dist/adaptive-selection.d.ts +3 -1
  48. package/host-runtime/dist/adaptive-selection.js +38 -9
  49. package/host-runtime/dist/adaptive-skip-decision.d.ts +61 -0
  50. package/host-runtime/dist/adaptive-skip-decision.js +114 -0
  51. package/host-runtime/dist/codex-ingestion-consent.d.ts +32 -95
  52. package/host-runtime/dist/codex-ingestion-consent.js +33 -205
  53. package/host-runtime/dist/conversation-ingestion/consent.d.ts +124 -0
  54. package/host-runtime/dist/conversation-ingestion/consent.js +531 -0
  55. package/host-runtime/dist/conversation-ingestion/index.d.ts +12 -0
  56. package/host-runtime/dist/conversation-ingestion/index.js +12 -0
  57. package/host-runtime/dist/conversation-ingestion/pipeline.d.ts +101 -0
  58. package/host-runtime/dist/conversation-ingestion/pipeline.js +162 -0
  59. package/host-runtime/dist/conversation-ingestion/source.d.ts +172 -0
  60. package/host-runtime/dist/conversation-ingestion/source.js +111 -0
  61. package/host-runtime/dist/conversation-ingestion/text-policy.d.ts +51 -0
  62. package/host-runtime/dist/conversation-ingestion/text-policy.js +68 -0
  63. package/host-runtime/dist/governance-observation-store.d.ts +9 -7
  64. package/host-runtime/dist/governance-observation-store.js +20 -4
  65. package/host-runtime/dist/index.d.ts +1 -0
  66. package/host-runtime/dist/index.js +6 -0
  67. package/host-runtime/dist/production-rulehost-gate.js +21 -1
  68. package/host-runtime/package.json +1 -1
  69. package/package.json +2 -2
  70. package/pd-cli/package.json +1 -1
  71. package/plugin/dist/bundle.js +470 -514
  72. package/plugin/dist/hooks/gate.d.ts +1 -1
  73. package/plugin/dist/openclaw.plugin.json +1 -1
  74. package/release-manager/dist/installers/codex-host-installer.js +20 -0
  75. package/release-manager/package.json +1 -1
@@ -34,7 +34,12 @@ export const GOVERNANCE_RETENTION_MAX_TURNS = 32;
34
34
  export const GOVERNANCE_RETENTION_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000;
35
35
  export const GOVERNANCE_PROMOTION_PRECEDING_TURNS = 12;
36
36
  export const GOVERNANCE_PENDING_TAIL_STALE_MS = 7 * 24 * 60 * 60 * 1000;
37
- const GOVERNANCE_OBSERVATION_SCHEMA_VERSION = 3;
37
+ // Schema v4 (PRI-1171): additive contract widening over v3 — host_kind admits
38
+ // 'workbuddy'/'openclaw' (app-layer union; the DDL keeps unconstrained TEXT),
39
+ // and the checkpoint upsert is MAX-monotonic (concurrent Stop × worker
40
+ // catch-up must never drag a committed water mark backwards). No v3 DDL is
41
+ // rewritten; existing stores bump the version row on next open.
42
+ const GOVERNANCE_OBSERVATION_SCHEMA_VERSION = 4;
38
43
  const MAX_TEXT_BOUND = 200; // matches MAX_EVIDENCE_VALUE_CHARS; guards stored identity fields
39
44
  const MAX_JSON_COLUMN = 8_000;
40
45
  function isRecord(value) {
@@ -426,13 +431,24 @@ export function ingestGovernanceObservations(input) {
426
431
  : firstDegradation
427
432
  ? { reason: firstDegradation.reason, ordinal: firstDegradation.ordinal ?? null }
428
433
  : null;
434
+ // Monotonic checkpoint (PRI-1171 review): a stale concurrent writer
435
+ // (Stop × worker catch-up) can neither drag the water mark back NOR
436
+ // refresh its companion fields — root_session_id, incomplete_tail,
437
+ // degradation bookkeeping, and updated_at advance only with a
438
+ // non-regressing byte_offset, so health-page state stays consistent
439
+ // with the committed mark.
429
440
  db.prepare(`INSERT INTO governance_transcript_checkpoints
430
441
  (host_kind, rollout_identity, byte_offset, last_ordinal, cli_version, root_session_id, incomplete_tail, last_degradation_reason, last_degradation_ordinal, updated_at)
431
442
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
432
443
  ON CONFLICT(host_kind, rollout_identity) DO UPDATE SET
433
- byte_offset = excluded.byte_offset, last_ordinal = excluded.last_ordinal, cli_version = COALESCE(excluded.cli_version, cli_version),
434
- root_session_id = excluded.root_session_id, incomplete_tail = excluded.incomplete_tail,
435
- last_degradation_reason = excluded.last_degradation_reason, last_degradation_ordinal = excluded.last_degradation_ordinal, updated_at = excluded.updated_at`)
444
+ byte_offset = MAX(governance_transcript_checkpoints.byte_offset, excluded.byte_offset),
445
+ last_ordinal = MAX(governance_transcript_checkpoints.last_ordinal, excluded.last_ordinal),
446
+ cli_version = COALESCE(excluded.cli_version, cli_version),
447
+ root_session_id = CASE WHEN excluded.byte_offset >= governance_transcript_checkpoints.byte_offset THEN excluded.root_session_id ELSE governance_transcript_checkpoints.root_session_id END,
448
+ incomplete_tail = CASE WHEN excluded.byte_offset >= governance_transcript_checkpoints.byte_offset THEN excluded.incomplete_tail ELSE governance_transcript_checkpoints.incomplete_tail END,
449
+ last_degradation_reason = CASE WHEN excluded.byte_offset >= governance_transcript_checkpoints.byte_offset THEN excluded.last_degradation_reason ELSE governance_transcript_checkpoints.last_degradation_reason END,
450
+ last_degradation_ordinal = CASE WHEN excluded.byte_offset >= governance_transcript_checkpoints.byte_offset THEN excluded.last_degradation_ordinal ELSE governance_transcript_checkpoints.last_degradation_ordinal END,
451
+ updated_at = CASE WHEN excluded.byte_offset >= governance_transcript_checkpoints.byte_offset THEN excluded.updated_at ELSE governance_transcript_checkpoints.updated_at END`)
436
452
  .run(input.checkpoint.hostKind, input.checkpoint.rolloutIdentity, byteOffset, input.checkpoint.lastOrdinal, input.checkpoint.cliVersion ?? null, input.checkpoint.rootSessionId, input.checkpoint.incompleteTail ? 1 : 0, lastDegradation?.reason ?? null, lastDegradation?.ordinal ?? null, now);
437
453
  }
438
454
  // Marker semantics: compaction replaces logical history (tombstone every
@@ -17,6 +17,7 @@ export * from './production-rulehost-gate.js';
17
17
  export * from './rule-implementation-runtime.js';
18
18
  export * from './production-pain-evidence.js';
19
19
  export * from './governance-observation-store.js';
20
+ export * from './conversation-ingestion/index.js';
20
21
  export * from './governance-signal-admission.js';
21
22
  export * from './signal-classifier.js';
22
23
  export * from './adaptive-selection.js';
@@ -29,6 +29,12 @@ export * from './production-rulehost-gate.js';
29
29
  export * from './rule-implementation-runtime.js';
30
30
  export * from './production-pain-evidence.js';
31
31
  export * from './governance-observation-store.js';
32
+ // PRI-1171: unified conversation-ingestion seam — the ONE host-neutral entry
33
+ // for transcript trajectory ingestion (source contract + shared pipeline +
34
+ // consent ledger v3 + text policy). Host decoders stay in their adapter
35
+ // packages; a new host implements TranscriptSourceAdapter with zero changes
36
+ // here.
37
+ export * from './conversation-ingestion/index.js';
32
38
  export * from './governance-signal-admission.js';
33
39
  export * from './signal-classifier.js';
34
40
  export * from './adaptive-selection.js';
@@ -673,7 +673,27 @@ export function createProductionRuleHostGate(options = {}) {
673
673
  }
674
674
  return { decision: 'deny', reason: result.reason, source: event.source, ...(warnings.length ? { warnings } : {}), metadata: { evaluatedLiveRules: implementations.length, ruleId: result.ruleId, principleId: result.principleId, evaluations } };
675
675
  }
676
- return { decision: 'allow', source: event.source, ...(warnings.length ? { warnings } : {}), metadata: { evaluatedLiveRules: implementations.length, ruleDecision: result?.decision ?? 'allow', evaluations } };
676
+ // Task 1 (legacy fallback convergence): a non-block verdict now carries
677
+ // the facts the OpenClaw adapter needs to record/apply it WITHOUT a
678
+ // second evaluation: winner identity, matched flag, rule reason and the
679
+ // already-merged (validated) correction proposal. `metadata` is
680
+ // host-neutral; adapters that do not consume these keys ignore them and
681
+ // never forward them into a host schema.
682
+ return {
683
+ decision: 'allow',
684
+ source: event.source,
685
+ ...(warnings.length ? { warnings } : {}),
686
+ metadata: {
687
+ evaluatedLiveRules: implementations.length,
688
+ ruleDecision: result?.decision ?? 'allow',
689
+ matched: result?.matched ?? false,
690
+ ...(result?.ruleId !== undefined ? { ruleId: result.ruleId } : {}),
691
+ ...(result?.principleId !== undefined ? { principleId: result.principleId } : {}),
692
+ ...(result?.reason !== undefined ? { ruleReason: result.reason } : {}),
693
+ ...(result !== undefined && result.correctionProposal !== undefined ? { correctionProposal: result.correctionProposal } : {}),
694
+ evaluations,
695
+ },
696
+ };
677
697
  }
678
698
  catch (error) {
679
699
  addWarning(warnings, `activation_read_failed: ${error instanceof Error ? error.message : String(error)}`, 'inspect state.db schema and integrity');
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/host-runtime",
3
- "version": "3.3.1",
3
+ "version": "3.4.0",
4
4
  "description": "Shared host-neutral orchestration for Principles Disciple MVP-Core hook paths.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-principles-disciple",
3
- "version": "1.150.1",
3
+ "version": "1.150.3",
4
4
  "description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
5
5
  "type": "module",
6
6
  "bin": {
@@ -101,5 +101,5 @@
101
101
  "pd": {
102
102
  "bundledPluginVersion": "3.2.1"
103
103
  },
104
- "gitHead": "8851a3be8c3bcacb732609143bfe3d2ac4ba4ea5"
104
+ "gitHead": "1851ac671ffc4391a0e732af2bca991e199d483e"
105
105
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/pd-cli",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "PD CLI — Pain recording, sample management, and governance tasks for Principles Disciple",
5
5
  "type": "module",
6
6
  "bin": {