create-principles-disciple 1.154.2 → 1.154.4
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/_release/product-identity.json +1 -1
- package/codex-adapter/dist/worker/workspace-worker.js +7 -1
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/models/ReceiptsConsoleModel.js +2 -2
- package/console/dist/web/assets/app.css +5 -0
- package/console/dist/web/assets/app.js +38 -38
- package/core/dist/runtime/feature-flags/feature-flag-contract.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-contract.js +1 -0
- package/core/dist/runtime/feature-flags/feature-flag-contract.js.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js +8 -0
- package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.d.ts +13 -0
- package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress-payload.js +26 -0
- package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
- package/core/dist/runtime/pain-ingress.d.ts +1 -1
- package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
- package/core/dist/runtime/pain-ingress.js +15 -2
- package/core/dist/runtime/pain-ingress.js.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.d.ts +18 -0
- package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-bridge.js +49 -1
- package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts +7 -0
- package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime/pain-signal-runtime-factory.js +2 -0
- package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime/pain-to-principle-service.d.ts +8 -0
- package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
- package/core/dist/runtime/pain-to-principle-service.js +21 -1
- package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
- package/core/package.json +1 -1
- package/host-runtime/dist/auto-pain-authorization.d.ts +29 -0
- package/host-runtime/dist/auto-pain-authorization.js +32 -0
- package/host-runtime/dist/diagnostician-auto-run.d.ts +1 -1
- package/host-runtime/dist/diagnostician-auto-run.js +41 -0
- package/host-runtime/dist/governance-signal-admission.js +16 -0
- package/host-runtime/dist/index.d.ts +1 -0
- package/host-runtime/dist/index.js +1 -0
- package/host-runtime/package.json +1 -1
- package/install-layout/dist/active-release.d.ts +41 -0
- package/install-layout/dist/active-release.js +131 -0
- package/install-layout/dist/index.d.ts +56 -5
- package/install-layout/dist/index.js +166 -1
- package/install-layout/dist/mcp-binding-contract.d.ts +76 -12
- package/install-layout/dist/mcp-binding-contract.js +183 -75
- package/install-layout/package.json +1 -1
- package/package.json +3 -3
- package/pd-cli/dist/commands/health-ingestion.d.ts.map +1 -1
- package/pd-cli/dist/commands/health-ingestion.js +6 -2
- package/pd-cli/dist/commands/health-ingestion.js.map +1 -1
- package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-record.js +4 -1
- package/pd-cli/dist/commands/pain-record.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +19 -1
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/commands/service-run-once.d.ts +6 -0
- package/pd-cli/dist/commands/service-run-once.d.ts.map +1 -0
- package/pd-cli/dist/commands/service-run-once.js +139 -0
- package/pd-cli/dist/commands/service-run-once.js.map +1 -0
- package/pd-cli/dist/program.d.ts.map +1 -1
- package/pd-cli/dist/program.js +21 -0
- package/pd-cli/dist/program.js.map +1 -1
- package/pd-cli/dist/services/pain-flood-simulation-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/pain-flood-simulation-runner.js +4 -0
- package/pd-cli/dist/services/pain-flood-simulation-runner.js.map +1 -1
- package/pd-cli/dist/services/service-host/index.d.ts +15 -0
- package/pd-cli/dist/services/service-host/index.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/index.js +15 -0
- package/pd-cli/dist/services/service-host/index.js.map +1 -0
- package/pd-cli/dist/services/service-host/install-identity.d.ts +79 -0
- package/pd-cli/dist/services/service-host/install-identity.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/install-identity.js +166 -0
- package/pd-cli/dist/services/service-host/install-identity.js.map +1 -0
- package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts +134 -0
- package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/locking/service-run-lock.js +659 -0
- package/pd-cli/dist/services/service-host/locking/service-run-lock.js.map +1 -0
- package/pd-cli/dist/services/service-host/owner-projection.d.ts +47 -0
- package/pd-cli/dist/services/service-host/owner-projection.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/owner-projection.js +121 -0
- package/pd-cli/dist/services/service-host/owner-projection.js.map +1 -0
- package/pd-cli/dist/services/service-host/run-once.d.ts +96 -0
- package/pd-cli/dist/services/service-host/run-once.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/run-once.js +440 -0
- package/pd-cli/dist/services/service-host/run-once.js.map +1 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.d.ts +117 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.js +150 -0
- package/pd-cli/dist/services/service-host/status/service-run-status.js.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-discovery.d.ts +71 -0
- package/pd-cli/dist/services/service-host/workspace-discovery.d.ts.map +1 -0
- package/pd-cli/dist/services/service-host/workspace-discovery.js +288 -0
- package/pd-cli/dist/services/service-host/workspace-discovery.js.map +1 -0
- package/pd-cli/dist/services/synthetic-baseline-runner.d.ts.map +1 -1
- package/pd-cli/dist/services/synthetic-baseline-runner.js +4 -0
- package/pd-cli/dist/services/synthetic-baseline-runner.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +420 -420
- package/plugin/dist/core/signal-collector-host.d.ts +12 -0
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/dist/templates/langs/en/skills/pd-pain-signal/SKILL.md +10 -2
- package/plugin/dist/templates/langs/zh/skills/pd-pain-signal/SKILL.md +10 -2
- package/plugin/mcp/launcher.cjs +40 -4
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +1 -1
- package/plugin/templates/langs/en/skills/pd-pain-signal/SKILL.md +10 -2
- package/plugin/templates/langs/zh/skills/pd-pain-signal/SKILL.md +10 -2
- package/release-manager/package.json +1 -1
- package/workbuddy-adapter/dist/worker/workspace-worker.js +4 -1
- package/workbuddy-adapter/package.json +1 -1
- package/workbuddy-adapter/plugin/mcp/launcher.cjs +40 -4
- package/workbuddy-adapter/plugin/skills/pd-pain-signal/SKILL.md +10 -2
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A lock older than this is treated as a crashed holder. A legitimate
|
|
3
|
+
* run-once (bounded cycles, Phase 2 per-workspace timeouts) must stay well
|
|
4
|
+
* below this window; the dry-run of Phase 1 finishes in seconds.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SERVICE_RUN_LOCK_STALE_MS: number;
|
|
7
|
+
/** The one lock file per install: `<pdHome>/service/service-run.lock`. */
|
|
8
|
+
export declare function serviceRunLockPath(pdHome: string): string;
|
|
9
|
+
export interface ServiceRunLockHandle {
|
|
10
|
+
readonly lockPath: string;
|
|
11
|
+
/** Random per-acquisition token; identifies THIS holder inside the body. */
|
|
12
|
+
readonly token: string;
|
|
13
|
+
/** The exact body we wrote; release and re-verification check it. */
|
|
14
|
+
readonly body: string;
|
|
15
|
+
}
|
|
16
|
+
export type AcquireServiceRunLockResult = {
|
|
17
|
+
ok: true;
|
|
18
|
+
handle: ServiceRunLockHandle;
|
|
19
|
+
staleTakenOver: boolean;
|
|
20
|
+
} | {
|
|
21
|
+
ok: false;
|
|
22
|
+
kind: 'held';
|
|
23
|
+
holderBodyHash: string;
|
|
24
|
+
} | {
|
|
25
|
+
ok: false;
|
|
26
|
+
kind: 'corrupt';
|
|
27
|
+
detail: string;
|
|
28
|
+
} | {
|
|
29
|
+
ok: false;
|
|
30
|
+
kind: 'unwritable';
|
|
31
|
+
detail: string;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Holder-liveness verdict. 'alive' includes EPERM-observable processes
|
|
35
|
+
* (exists, we just can't signal it). 'unknown' means the platform could not
|
|
36
|
+
* produce a reliable verdict — takeover must fail CLOSED on it.
|
|
37
|
+
*/
|
|
38
|
+
export type HolderLiveness = 'alive' | 'dead' | 'unknown';
|
|
39
|
+
/**
|
|
40
|
+
* Deterministic injection points inside the arbitrated takeover section so
|
|
41
|
+
* multi-process tests can interleave contenders without random sleeps.
|
|
42
|
+
* Called synchronously INSIDE the arbitration transaction — a contender
|
|
43
|
+
* parked here still holds the gate, which is exactly what the tests need to
|
|
44
|
+
* prove: nobody else can even evaluate the lock meanwhile.
|
|
45
|
+
* A thrown error aborts the takeover fail-closed (transaction rolled back).
|
|
46
|
+
*/
|
|
47
|
+
export type ServiceRunLockTakeoverPhase = 'mutex-acquired' | 'stale-verified' | 'lock-removed';
|
|
48
|
+
export interface ServiceRunLockProbes {
|
|
49
|
+
/**
|
|
50
|
+
* Liveness probe for the PID recorded in a stale lock body. Default:
|
|
51
|
+
* `process.kill(pid, 0)` semantics (alive / ESRCH→dead / EPERM→alive /
|
|
52
|
+
* anything else→unknown). Tests inject fakes; the contract is that an
|
|
53
|
+
* inconclusive answer MUST yield 'unknown' (fail-closed), never 'dead'.
|
|
54
|
+
*/
|
|
55
|
+
readonly processAlive?: (pid: number) => HolderLiveness;
|
|
56
|
+
/**
|
|
57
|
+
* Synchronization hook for deterministic takeover-interleaving tests.
|
|
58
|
+
* Invoked once per phase inside the arbitration transaction; production
|
|
59
|
+
* passes nothing.
|
|
60
|
+
*/
|
|
61
|
+
readonly takeoverSync?: (phase: ServiceRunLockTakeoverPhase) => void;
|
|
62
|
+
/**
|
|
63
|
+
* Deterministic test seam: force the gate transaction's END to fail after
|
|
64
|
+
* the acquire body ran — exercises the orphan-lock compensation path
|
|
65
|
+
* (§P0). Production never sets it.
|
|
66
|
+
*/
|
|
67
|
+
readonly gateEndFailure?: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Structured lock-file read outcome (P0 round 6): a missing file and an
|
|
71
|
+
* existing-but-unreadable file are different facts and the release path
|
|
72
|
+
* MUST distinguish them — EACCES/EPERM/EIO/EISDIR are degraded evidence,
|
|
73
|
+
* never `not_owned`.
|
|
74
|
+
*/
|
|
75
|
+
export type LockBodyRead = {
|
|
76
|
+
readonly kind: 'readable';
|
|
77
|
+
readonly body: string;
|
|
78
|
+
} | {
|
|
79
|
+
readonly kind: 'absent';
|
|
80
|
+
} | {
|
|
81
|
+
readonly kind: 'unreadable';
|
|
82
|
+
readonly detail: string;
|
|
83
|
+
};
|
|
84
|
+
export declare function readLockBodyStatus(lockPath: string): LockBodyRead;
|
|
85
|
+
/** True when the lock file still carries OUR body (mid-run ownership re-check). */
|
|
86
|
+
export declare function holdsServiceRunLock(handle: ServiceRunLockHandle): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Acquire the install-level single-instance run lock. Every decision —
|
|
89
|
+
* evaluate, stale takeover, create — runs inside the arbitration gate
|
|
90
|
+
* (§P1-4 round 4), immediate verdicts, no wait loop (`already_running`
|
|
91
|
+
* semantics, §8.2). A stale takeover additionally requires the recorded
|
|
92
|
+
* holder PID to be demonstrably DEAD; a live, unknown or unverifiable
|
|
93
|
+
* holder is NEVER taken over, and the verify→delete→create sequence is
|
|
94
|
+
* serialized by the same transaction that a second contender's BEGIN
|
|
95
|
+
* cannot enter.
|
|
96
|
+
*/
|
|
97
|
+
export declare function acquireServiceRunLock(pdHome: string, options?: {
|
|
98
|
+
staleMs?: number;
|
|
99
|
+
probes?: ServiceRunLockProbes;
|
|
100
|
+
}): AcquireServiceRunLockResult;
|
|
101
|
+
/**
|
|
102
|
+
* Structured release outcome (§三): a release can never be silent.
|
|
103
|
+
* - `released` — our lock was verified and unlinked under the gate;
|
|
104
|
+
* - `not_owned` — the lock is gone or already another holder's;
|
|
105
|
+
* never an error, and never deletes a foreign body;
|
|
106
|
+
* - `failed_busy` — the arbiter stayed busy through the bounded retry;
|
|
107
|
+
* - `failed_unwritable` — the gate/transaction itself failed.
|
|
108
|
+
*/
|
|
109
|
+
export type ReleaseServiceRunLockResult = 'released' | 'not_owned' | 'failed_busy' | 'failed_unwritable';
|
|
110
|
+
export interface ReleaseServiceRunLockOptions {
|
|
111
|
+
/** Deterministic test seam: force the release transaction's end to fail. */
|
|
112
|
+
readonly injectEndFailure?: boolean;
|
|
113
|
+
/** Hook invoked once inside the release transaction (deterministic tests). */
|
|
114
|
+
readonly insideTxn?: () => void;
|
|
115
|
+
/**
|
|
116
|
+
* Deterministic test seam: replace the lock-file read inside the
|
|
117
|
+
* release transaction (default: the real classified read). Lets tests
|
|
118
|
+
* reproduce EACCES/EPERM/EIO on every platform without depending on OS
|
|
119
|
+
* permission behavior — production never sets it.
|
|
120
|
+
*/
|
|
121
|
+
readonly readBody?: (lockPath: string) => LockBodyRead;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Ownership-checked release under the SAME arbitration gate: verify the
|
|
125
|
+
* lock body is OURS and unlink it inside one transaction — a true
|
|
126
|
+
* compare-and-delete, so the file a foreign holder just created can never
|
|
127
|
+
* be removed by our late release (P1-4). The release gets its own bounded
|
|
128
|
+
* retry (`RELEASE_BUSY_TIMEOUT_MS` × `RELEASE_MAX_ATTEMPTS`) independent of
|
|
129
|
+
* acquire's zero-wait policy, but NEVER bypasses the gate to unlink: a gate
|
|
130
|
+
* failure leaves the lock in place and reports it — the leftover carries
|
|
131
|
+
* our own PID, which the next contender recovers on death evidence.
|
|
132
|
+
*/
|
|
133
|
+
export declare function releaseServiceRunLock(handle: ServiceRunLockHandle, options?: ReleaseServiceRunLockOptions): ReleaseServiceRunLockResult;
|
|
134
|
+
//# sourceMappingURL=service-run-lock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-run-lock.d.ts","sourceRoot":"","sources":["../../../../src/services/service-host/locking/service-run-lock.ts"],"names":[],"mappings":"AA2FA;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,QAAiB,CAAC;AAcxD,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAEzD;AAWD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,2BAA2B,GACnC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAC;IAAC,cAAc,EAAE,OAAO,CAAA;CAAE,GACnE;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC9C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,MAAM,2BAA2B,GACnC,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,C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