principles-disciple 1.151.0 → 1.152.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.
package/dist/commands/pain.js
CHANGED
|
@@ -5,6 +5,7 @@ import { resolvePluginCommandWorkspaceDir } from '../utils/workspace-resolver.js
|
|
|
5
5
|
import { computeHash } from '../utils/hashing.js';
|
|
6
6
|
import { PainToPrincipleService, PrincipleTreeLedgerAdapter } from '@principles/core/runtime-v2';
|
|
7
7
|
import { loadPdConfigForPlugin } from '../core/pd-config-loader.js';
|
|
8
|
+
import { createIntentDocReader } from '../core/intent-doc-reader-adapter.js';
|
|
8
9
|
/**
|
|
9
10
|
* Creates a visual progress bar (e.g., [██████░░░░])
|
|
10
11
|
*/
|
|
@@ -274,6 +275,7 @@ export async function handlePainReportCommand(ctx) {
|
|
|
274
275
|
autoIntakeEnabled: true,
|
|
275
276
|
effectiveConfig: configResult.effective,
|
|
276
277
|
getEnvVar: (name) => process.env[name],
|
|
278
|
+
intentDocReader: createIntentDocReader(wctx.workspaceDir),
|
|
277
279
|
});
|
|
278
280
|
const result = await service.recordPain({
|
|
279
281
|
painId: painData.painId,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRI-468 — Plugin adapter implementing the core `IntentDocReader` port.
|
|
3
|
+
*
|
|
4
|
+
* Bridges the plugin-owned `safeReadIntentDoc()` I/O function to the
|
|
5
|
+
* core-owned `IntentDocReader` interface so Stage A (in core) can read
|
|
6
|
+
* INTENT.md without core performing any filesystem I/O.
|
|
7
|
+
*
|
|
8
|
+
* This adapter only MAPS types — it adds no new I/O, no new flag checks,
|
|
9
|
+
* and no new telemetry. The underlying `safeReadIntentDoc()` already
|
|
10
|
+
* performs the flag-first check (SPEC §12), TTL+mtime cache, and size cap.
|
|
11
|
+
*
|
|
12
|
+
* ERR checklist:
|
|
13
|
+
* EP-01 / ERR-001: never `as` — field-by-field mapping with typeof checks
|
|
14
|
+
* EP-02 / ERR-025: plugin I/O file, whitelisted in architecture-regression
|
|
15
|
+
* EP-03 / ERR-002: every degraded path flows through with reason + nextAction
|
|
16
|
+
*
|
|
17
|
+
* Architecture: this file is I/O (delegates to fs-reading safeReadIntentDoc).
|
|
18
|
+
* It will be added to KNOWN_PLUGIN_CORE_FILES in architecture-regression.test.ts.
|
|
19
|
+
*/
|
|
20
|
+
import type { IntentDocReader } from '@principles/core/runtime-v2';
|
|
21
|
+
/**
|
|
22
|
+
* Create an IntentDocReader bound to a specific workspace.
|
|
23
|
+
*
|
|
24
|
+
* The returned reader is stateless beyond the workspace binding — each
|
|
25
|
+
* `readIntentDoc()` call delegates to `safeReadIntentDoc()`, which owns
|
|
26
|
+
* the TTL+mtime cache.
|
|
27
|
+
*/
|
|
28
|
+
export declare function createIntentDocReader(workspaceDir: string): IntentDocReader;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PRI-468 — Plugin adapter implementing the core `IntentDocReader` port.
|
|
3
|
+
*
|
|
4
|
+
* Bridges the plugin-owned `safeReadIntentDoc()` I/O function to the
|
|
5
|
+
* core-owned `IntentDocReader` interface so Stage A (in core) can read
|
|
6
|
+
* INTENT.md without core performing any filesystem I/O.
|
|
7
|
+
*
|
|
8
|
+
* This adapter only MAPS types — it adds no new I/O, no new flag checks,
|
|
9
|
+
* and no new telemetry. The underlying `safeReadIntentDoc()` already
|
|
10
|
+
* performs the flag-first check (SPEC §12), TTL+mtime cache, and size cap.
|
|
11
|
+
*
|
|
12
|
+
* ERR checklist:
|
|
13
|
+
* EP-01 / ERR-001: never `as` — field-by-field mapping with typeof checks
|
|
14
|
+
* EP-02 / ERR-025: plugin I/O file, whitelisted in architecture-regression
|
|
15
|
+
* EP-03 / ERR-002: every degraded path flows through with reason + nextAction
|
|
16
|
+
*
|
|
17
|
+
* Architecture: this file is I/O (delegates to fs-reading safeReadIntentDoc).
|
|
18
|
+
* It will be added to KNOWN_PLUGIN_CORE_FILES in architecture-regression.test.ts.
|
|
19
|
+
*/
|
|
20
|
+
import { safeReadIntentDoc } from './intent-doc-reader.js';
|
|
21
|
+
/**
|
|
22
|
+
* Create an IntentDocReader bound to a specific workspace.
|
|
23
|
+
*
|
|
24
|
+
* The returned reader is stateless beyond the workspace binding — each
|
|
25
|
+
* `readIntentDoc()` call delegates to `safeReadIntentDoc()`, which owns
|
|
26
|
+
* the TTL+mtime cache.
|
|
27
|
+
*/
|
|
28
|
+
export function createIntentDocReader(workspaceDir) {
|
|
29
|
+
return {
|
|
30
|
+
readIntentDoc() {
|
|
31
|
+
const result = safeReadIntentDoc(workspaceDir);
|
|
32
|
+
if (result.ok && result.doc) {
|
|
33
|
+
const doc = result.doc;
|
|
34
|
+
const reference = {
|
|
35
|
+
raw: typeof doc.raw === 'string' ? doc.raw : '',
|
|
36
|
+
contentHash: typeof doc.contentHash === 'string' ? doc.contentHash : '',
|
|
37
|
+
path: typeof doc.path === 'string' ? doc.path : '',
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
ok: true,
|
|
41
|
+
found: true,
|
|
42
|
+
flagEnabled: true,
|
|
43
|
+
doc: reference,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Degraded path — preserve structured reason + nextAction (EP-03 / ERR-002)
|
|
47
|
+
return {
|
|
48
|
+
ok: false,
|
|
49
|
+
found: result.found,
|
|
50
|
+
flagEnabled: result.flagEnabled,
|
|
51
|
+
reason: result.reason,
|
|
52
|
+
nextAction: result.nextAction,
|
|
53
|
+
};
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
package/dist/hooks/pain.js
CHANGED
|
@@ -25,6 +25,7 @@ import { resolveWorkspaceDirForRuntimeV2 } from '../utils/workspace-resolver.js'
|
|
|
25
25
|
import { PainToPrincipleService, PrincipleTreeLedgerAdapter } from '@principles/core/runtime-v2';
|
|
26
26
|
import { evaluatePainDiagnosticGate } from '../core/pain-diagnostic-gate.js';
|
|
27
27
|
import { loadPdConfigForPlugin, loadFeatureFlagFromConfig } from '../core/pd-config-loader.js';
|
|
28
|
+
import { createIntentDocReader } from '../core/intent-doc-reader-adapter.js';
|
|
28
29
|
import { evaluateTriggerController } from '@principles/core/runtime-v2';
|
|
29
30
|
import { isSharedCooldownActive, markSharedEpisodeAsDiagnosed } from './trigger-cooldown-tracker.js';
|
|
30
31
|
import { buildManualPainObservation, resolveSourceKind } from './raw-observation-adapter.js';
|
|
@@ -44,6 +45,10 @@ function createPainToPrincipleService(wctx) {
|
|
|
44
45
|
autoIntakeEnabled: true,
|
|
45
46
|
effectiveConfig: configResult.effective,
|
|
46
47
|
getEnvVar: (name) => process.env[name],
|
|
48
|
+
// PRI-468: wire INTENT.md reader so Stage A can produce intentTension
|
|
49
|
+
// when intent_engineering flag is on. Adapter performs no I/O beyond
|
|
50
|
+
// delegating to safeReadIntentDoc (which owns the flag-first check).
|
|
51
|
+
intentDocReader: createIntentDocReader(wctx.workspaceDir),
|
|
47
52
|
});
|
|
48
53
|
}
|
|
49
54
|
// buildTrajectoryEvidence is in ./trajectory-evidence.ts (re-exported above)
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "principles-disciple",
|
|
3
3
|
"name": "Principles Disciple",
|
|
4
4
|
"description": "Evolutionary programming agent framework with strategic guardrails and reflection loops.",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.152.0",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onCapabilities": [
|
|
8
8
|
"hook"
|