@principles/pd-cli 1.127.0 → 1.128.0

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 (2) hide show
  1. package/README.md +6 -6
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,7 +12,7 @@ npm install -g @principles/pd-cli
12
12
 
13
13
  ### `pd pain record`
14
14
 
15
- Record a pain signal to the workspace's `.pain_flag` file.
15
+ Record a pain signal to the workspace's trajectory database via `PainToPrincipleService`.
16
16
 
17
17
  ```bash
18
18
  pd pain record --reason "edited file without reading first" --score 75
@@ -81,10 +81,10 @@ node packages/pd-cli/dist/index.js runtime pruning orphans --workspace "D:\.open
81
81
 
82
82
  Only add `--confirm` after reviewing the dry-run output. Never run remediation without understanding what it will change.
83
83
 
84
- ## Migration from openclaw tools
84
+ ## Pain Recording Architecture
85
85
 
86
- The `pd pain record` CLI and the existing `write_pain_flag` tool write to the same pain flag file (`.state/.pain_flag`). They can coexist safely:
86
+ The `pd pain record` CLI records pain signals directly to the workspace's trajectory database via `PainToPrincipleService` (Runtime V2). The legacy `.state/.pain_flag` file is no longer written or read by the active runtime — all pain events flow through `emitPainDetectedEvent` → `PainSignalBridge` → `trajectory.db`.
87
87
 
88
- - **Concurrency**: `recordPainSignal` in the SDK uses an in-process async queue lock to serialize writes within a single process. For cross-process safety (e.g., simultaneous tool + CLI calls), both paths rely on atomic file rename via `atomicWriteFileSync`.
89
- - **Progressive migration**: Agents using openclaw tools can migrate to `pd pain record` incrementally both paths write the same format and are processed identically by the evolution system.
90
- - **No dual-write data loss**: The pain flag is a point-in-time snapshot; each write is atomic. Conflicting concurrent writes result in last-write-wins on the flag content, which is acceptable for pain signals.
88
+ - **Single source of truth**: Pain events are stored in `trajectory.db` (SQLite), not in flat files.
89
+ - **No file-based concurrency concerns**: SQLite handles concurrent access; the legacy `atomicWriteFileSync` file-locking path is retired.
90
+ - **Runtime V2 pipeline**: Pain signals enter the diagnostician pipeline through `PainToPrincipleService.recordPain()`, which creates diagnostic tasks in the task store.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/pd-cli",
3
- "version": "1.127.0",
3
+ "version": "1.128.0",
4
4
  "description": "PD CLI — Pain recording, sample management, and evolution tasks",
5
5
  "type": "module",
6
6
  "bin": {