create-principles-disciple 1.144.11 → 1.144.13
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/pd-hook.js +23 -5
- package/codex-adapter/dist/worker/workspace-worker.d.ts +6 -0
- package/codex-adapter/dist/worker/workspace-worker.js +7 -0
- package/codex-adapter/package.json +1 -1
- package/console/dist/server/models/ApprovalsConsoleModel.d.ts +1 -1
- package/console/dist/server/models/ApprovalsConsoleModel.js +4 -4
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.d.ts +5 -5
- package/console/dist/server/models/ApprovalsGroupedConsoleModel.js +18 -18
- package/console/dist/shared/prompt-injection-contract.d.ts +5 -5
- package/console/dist/ui/pages/focus/FocusPage.js +1 -1
- package/console/dist/ui/pages/focus/focus-validation.js +1 -1
- package/console/dist/ui/utils/approval-warning-localization.js +1 -1
- package/console/dist/ui/utils/validators.d.ts +1 -1
- package/console/dist/ui/utils/validators.js +2 -2
- package/console/package.json +3 -3
- package/core/dist/principle-tree-ledger.d.ts +50 -0
- package/core/dist/principle-tree-ledger.d.ts.map +1 -1
- package/core/dist/principle-tree-ledger.js +133 -1
- package/core/dist/principle-tree-ledger.js.map +1 -1
- package/core/dist/runtime-v2/adapter/output-schema-registry.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/output-schema-registry.js +4 -0
- package/core/dist/runtime-v2/adapter/output-schema-registry.js.map +1 -1
- package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts +24 -0
- package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.d.ts.map +1 -1
- package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.js +36 -1
- package/core/dist/runtime-v2/adapter/principle-tree-ledger-adapter.js.map +1 -1
- package/core/dist/runtime-v2/bridge-result-shaper.d.ts +8 -0
- package/core/dist/runtime-v2/bridge-result-shaper.d.ts.map +1 -1
- package/core/dist/runtime-v2/bridge-result-shaper.js +61 -3
- package/core/dist/runtime-v2/bridge-result-shaper.js.map +1 -1
- package/core/dist/runtime-v2/candidate-intake-service.d.ts +152 -3
- package/core/dist/runtime-v2/candidate-intake-service.d.ts.map +1 -1
- package/core/dist/runtime-v2/candidate-intake-service.js +405 -47
- package/core/dist/runtime-v2/candidate-intake-service.js.map +1 -1
- package/core/dist/runtime-v2/candidate-intake.d.ts +44 -0
- package/core/dist/runtime-v2/candidate-intake.d.ts.map +1 -1
- package/core/dist/runtime-v2/candidate-intake.js +7 -0
- package/core/dist/runtime-v2/candidate-intake.js.map +1 -1
- package/core/dist/runtime-v2/config/index.d.ts +2 -2
- package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/index.js +1 -1
- package/core/dist/runtime-v2/config/index.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.d.ts +7 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-defaults.js +11 -0
- package/core/dist/runtime-v2/config/pd-config-defaults.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-effective.js +24 -1
- package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-redaction.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-redaction.js +2 -0
- package/core/dist/runtime-v2/config/pd-config-redaction.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-types.d.ts +39 -0
- package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
- package/core/dist/runtime-v2/config/pd-config-validate.js +44 -0
- package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +14 -1
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +21 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/pain-signal-bridge.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-bridge.js +107 -2
- package/core/dist/runtime-v2/pain-signal-bridge.js.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +29 -14
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js +215 -46
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/core/dist/runtime-v2/principle-reuse/reuse-domain.d.ts +89 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-domain.d.ts.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-domain.js +16 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-domain.js.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-output.d.ts +40 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-output.d.ts.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-output.js +97 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-output.js.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-runner.d.ts +111 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-runner.d.ts.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-runner.js +232 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-evaluation-runner.js.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-proposal.d.ts +87 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-proposal.d.ts.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-proposal.js +99 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-proposal.js.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-retrieval.d.ts +36 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-retrieval.d.ts.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-retrieval.js +118 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-retrieval.js.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-shortlist.d.ts +40 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-shortlist.d.ts.map +1 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-shortlist.js +184 -0
- package/core/dist/runtime-v2/principle-reuse/reuse-shortlist.js.map +1 -0
- package/core/dist/runtime-v2/store/pain-diagnosis/pain-diagnosis-store.d.ts +7 -0
- package/core/dist/runtime-v2/store/pain-diagnosis/pain-diagnosis-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/pain-diagnosis/pain-diagnosis-store.js.map +1 -1
- package/core/dist/runtime-v2/store/pain-diagnosis/sqlite-pain-diagnosis-store.d.ts +1 -0
- package/core/dist/runtime-v2/store/pain-diagnosis/sqlite-pain-diagnosis-store.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/pain-diagnosis/sqlite-pain-diagnosis-store.js +12 -0
- package/core/dist/runtime-v2/store/pain-diagnosis/sqlite-pain-diagnosis-store.js.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.d.ts +5 -0
- package/core/dist/runtime-v2/store/runtime-state-manager.d.ts.map +1 -1
- package/core/dist/runtime-v2/store/runtime-state-manager.js +8 -0
- package/core/dist/runtime-v2/store/runtime-state-manager.js.map +1 -1
- package/core/dist/runtime-v2/types/principle-schema.d.ts +65 -0
- package/core/dist/runtime-v2/types/principle-schema.d.ts.map +1 -1
- package/core/dist/runtime-v2/types/principle-schema.js +14 -0
- package/core/dist/runtime-v2/types/principle-schema.js.map +1 -1
- package/core/dist/runtime-v2/types/principle-tree-store.d.ts +12 -0
- package/core/dist/runtime-v2/types/principle-tree-store.d.ts.map +1 -1
- package/core/dist/telemetry-event.d.ts +2 -2
- package/core/dist/telemetry-event.d.ts.map +1 -1
- package/core/dist/telemetry-event.js +13 -0
- package/core/dist/telemetry-event.js.map +1 -1
- package/core/package.json +2 -2
- package/host-runtime/dist/index.d.ts +2 -0
- package/host-runtime/dist/index.js +1 -0
- package/host-runtime/dist/production-rulehost-gate.d.ts +1 -0
- package/host-runtime/dist/production-rulehost-gate.js +1 -1
- package/host-runtime/dist/prompt-injection-projection.d.ts +5 -5
- package/host-runtime/dist/prompt-injection-projection.js +4 -4
- package/host-runtime/package.json +1 -1
- package/package.json +3 -3
- package/pd-cli/dist/commands/candidate.d.ts +27 -0
- package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
- package/pd-cli/dist/commands/candidate.js +508 -14
- package/pd-cli/dist/commands/candidate.js.map +1 -1
- package/pd-cli/dist/commands/config-doctor.d.ts.map +1 -1
- package/pd-cli/dist/commands/config-doctor.js +14 -0
- package/pd-cli/dist/commands/config-doctor.js.map +1 -1
- package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
- package/pd-cli/dist/commands/diagnose.js +84 -14
- package/pd-cli/dist/commands/diagnose.js.map +1 -1
- package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
- package/pd-cli/dist/commands/pain-retry.js +97 -14
- package/pd-cli/dist/commands/pain-retry.js.map +1 -1
- package/pd-cli/dist/index.js +16 -2
- package/pd-cli/dist/index.js.map +1 -1
- package/pd-cli/dist/services/config-doctor.d.ts +11 -0
- package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
- package/pd-cli/dist/services/config-doctor.js +6 -0
- package/pd-cli/dist/services/config-doctor.js.map +1 -1
- package/pd-cli/dist/services/resolve-runtime-from-pd-config.d.ts +14 -0
- package/pd-cli/dist/services/resolve-runtime-from-pd-config.d.ts.map +1 -1
- package/pd-cli/dist/services/resolve-runtime-from-pd-config.js +20 -4
- package/pd-cli/dist/services/resolve-runtime-from-pd-config.js.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.d.ts +6 -0
- package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.js +11 -2
- package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +550 -546
- package/plugin/dist/openclaw.plugin.json +1 -1
- package/plugin/openclaw.plugin.json +1 -1
- package/plugin/package.json +5 -5
- package/release-manager/package.json +3 -3
|
@@ -4,12 +4,20 @@
|
|
|
4
4
|
* Workflow:
|
|
5
5
|
* 1. Validate input
|
|
6
6
|
* 2. Check idempotency (existsForCandidate) — O(1) lookup
|
|
7
|
+
* 2b. Check durable reuse resolution replay (PRI-917 PR3B Phase 2) —
|
|
8
|
+
* a candidate already resolved into an existing Principle returns that
|
|
9
|
+
* resolution; no decision is re-asked, no Principle is created
|
|
7
10
|
* 3. Load candidate from DB (RuntimeStateManager)
|
|
8
11
|
* 3b. ★ Principle Ledger write boundary (Phase 1 / PR1) — see below
|
|
9
12
|
* 4. Load artifact from DB and parse recommendation
|
|
10
13
|
* 5. Build 11-field LedgerPrincipleEntry
|
|
11
14
|
* 6. Write via adapter.writeProbationEntry()
|
|
12
15
|
*
|
|
16
|
+
* 4d (PRI-917 Slice 2 + PR3B Phase 2) — the reuse gate sits between 4c and 5:
|
|
17
|
+
* a credible proposal + a `reuse` verdict is materialised as durable evidence
|
|
18
|
+
* on the selected Principle (appendReuseEvidence) and reported as a
|
|
19
|
+
* `reuse_selected` refusal; a `create` verdict proceeds exactly as before.
|
|
20
|
+
*
|
|
13
21
|
* ── Principle Ledger write boundary (Phase 1 / PR1) ─────────────────────────
|
|
14
22
|
* This service is the single shared chokepoint through which EVERY
|
|
15
23
|
* candidate-origin write to the Principle Ledger flows (pd-cli `candidate
|
|
@@ -33,8 +41,13 @@
|
|
|
33
41
|
* - No promotion to active principle (M8+)
|
|
34
42
|
* - No pain signal bridge
|
|
35
43
|
*/
|
|
36
|
-
import type { LedgerAdapter, LedgerPrincipleEntry } from './candidate-intake.js';
|
|
44
|
+
import type { LedgerAdapter, LedgerPrincipleEntry, Recommendation } from './candidate-intake.js';
|
|
45
|
+
import { CandidateIntakeError } from './candidate-intake.js';
|
|
37
46
|
import type { RuntimeStateManager } from './store/runtime-state-manager.js';
|
|
47
|
+
import type { ReuseDecision, ReuseProposal } from './principle-reuse/reuse-proposal.js';
|
|
48
|
+
import type { ReuseEvaluationOutputV1 } from './principle-reuse/reuse-evaluation-output.js';
|
|
49
|
+
import type { ReuseCandidateInput } from './principle-reuse/reuse-domain.js';
|
|
50
|
+
import type { ReuseEvidenceEntry } from './types/principle-schema.js';
|
|
38
51
|
/**
|
|
39
52
|
* Why the Principle Ledger write boundary refused a candidate (Phase 1 / PR1).
|
|
40
53
|
*
|
|
@@ -43,8 +56,33 @@ import type { RuntimeStateManager } from './store/runtime-state-manager.js';
|
|
|
43
56
|
* candidate keeps flowing through its existing route / defer handling.
|
|
44
57
|
* - `unknown_kind` — no usable kind at all (missing / non-string / not in the
|
|
45
58
|
* known set). This is the case that previously FAILED OPEN into a principle.
|
|
59
|
+
* - `reuse_selected` (PRI-917 Slice 2) — the reuse gate produced a credible
|
|
60
|
+
* proposal and the injected decision function answered `reuse`, so no new
|
|
61
|
+
* Principle was written. Encoded as a refusal rather than a new result
|
|
62
|
+
* variant, which keeps the result-union shape stable for every consumer.
|
|
63
|
+
* PRI-917 PR3B Phase 2: the verdict is now ALSO materialised as durable
|
|
64
|
+
* evidence on the selected Principle (`reuseEvidence[]`) before this
|
|
65
|
+
* disposition is returned, and this reason doubles as the replay
|
|
66
|
+
* disposition when a candidate's resolution already exists (no new decision
|
|
67
|
+
* is asked, no Principle is created — INV-R07).
|
|
68
|
+
*
|
|
69
|
+
* ⚠ That is shape compatibility ONLY, not message compatibility. Known
|
|
70
|
+
* counter-example (verified, not fixed here): `pd candidate` presents ANY
|
|
71
|
+
* refusal as "this candidate kind does not target the Principle Ledger" and
|
|
72
|
+
* re-throws it as INPUT_INVALID — both wrong for a reuse decision, which
|
|
73
|
+
* DOES target the Ledger. No production caller injects `reuseDecision`
|
|
74
|
+
* yet, so this cannot surface today; but any consumer that renders
|
|
75
|
+
* refusal-specific operator messages MUST branch on
|
|
76
|
+
* `reason === 'reuse_selected'` BEFORE production reuse is enabled.
|
|
77
|
+
* - `reuse_pending_owner` (PRI-917 v0.3.3, OD-PRI917-05) — the Reuse Review
|
|
78
|
+
* Gate ran the semantic evaluation on the AUTO path (no Owner decision
|
|
79
|
+
* function present) and the recommendation was `reuse` with a selection
|
|
80
|
+
* inside the proposal. No Principle is created, NO evidence is written, and
|
|
81
|
+
* the candidate stays PENDING for the Owner. Consumers MUST branch on this
|
|
82
|
+
* reason: unlike every other refusal, the candidate is intentionally kept
|
|
83
|
+
* pending — do not mark it consumed and do not seed internalization for it.
|
|
46
84
|
*/
|
|
47
|
-
export type LedgerRefusalReason = 'non_principle_kind' | 'unknown_kind';
|
|
85
|
+
export type LedgerRefusalReason = 'non_principle_kind' | 'unknown_kind' | 'reuse_selected' | 'reuse_pending_owner';
|
|
48
86
|
/**
|
|
49
87
|
* Explicit disposition returned by {@link CandidateIntakeService.intake}.
|
|
50
88
|
*
|
|
@@ -57,18 +95,125 @@ export type CandidateIntakeResult = {
|
|
|
57
95
|
/** `true` when THIS call wrote a new entry; `false` for the idempotent no-op. */
|
|
58
96
|
readonly written: boolean;
|
|
59
97
|
readonly entry: LedgerPrincipleEntry;
|
|
98
|
+
/**
|
|
99
|
+
* PRI-917 Slice 2 — what the reuse gate did, for observability.
|
|
100
|
+
* Optional so every existing producer of this variant stays valid.
|
|
101
|
+
*/
|
|
102
|
+
readonly reuseCheck?: ReuseCheckOutcome;
|
|
60
103
|
} | {
|
|
61
104
|
readonly outcome: 'refused';
|
|
62
105
|
readonly reason: LedgerRefusalReason;
|
|
63
106
|
readonly candidateId: string;
|
|
64
|
-
/** The raw persisted kind, or `null` when it was absent / not a string. */
|
|
107
|
+
/** The raw persisted kind, or `null` when it was absent / not a string / not loaded. */
|
|
65
108
|
readonly rawRecommendationKind: string | null;
|
|
66
109
|
readonly message: string;
|
|
110
|
+
/** PRI-917 Slice 2 — present only when `reason === 'reuse_selected'`. */
|
|
111
|
+
readonly reuseProposal?: ReuseProposal;
|
|
112
|
+
/** The Principle the decision function selected, when it chose reuse. */
|
|
113
|
+
readonly selectedPrincipleId?: string;
|
|
114
|
+
/**
|
|
115
|
+
* PRI-917 PR3B Phase 2 — present only when `reason === 'reuse_selected'`:
|
|
116
|
+
* the evidence entry just written (fresh decision), or the pre-existing
|
|
117
|
+
* resolution (replay). This is the durable record that the candidate was
|
|
118
|
+
* resolved into `selectedPrincipleId` instead of creating a Principle.
|
|
119
|
+
*/
|
|
120
|
+
readonly reuseEvidence?: ReuseEvidenceEntry;
|
|
121
|
+
/**
|
|
122
|
+
* PRI-917 v0.3.3 — present only when `reason === 'reuse_pending_owner'`:
|
|
123
|
+
* the semantic recommendation that triggered the park. NEVER persisted —
|
|
124
|
+
* the Owner re-evaluates via `pd candidate review` (T7: proposal output
|
|
125
|
+
* cannot mutate ledger/evidence; the park itself writes nothing).
|
|
126
|
+
*/
|
|
127
|
+
readonly reuseRecommendation?: ReuseRecommendationOutcome;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* PRI-917 v0.3.3 — outcome of the auto-path Reuse Review Gate's evaluation
|
|
131
|
+
* hook. `recommended` wraps the validated `reuse-evaluation-output-v1` payload
|
|
132
|
+
* (a RECOMMENDATION — never a decision); `unavailable` is the observable
|
|
133
|
+
* degradation that lets CREATE proceed (SPEC v0.3.3 Rule 4: evaluation failure
|
|
134
|
+
* must never block learning).
|
|
135
|
+
*/
|
|
136
|
+
export type ReuseRecommendationOutcome = ({
|
|
137
|
+
status: 'recommended';
|
|
138
|
+
} & ReuseEvaluationOutputV1) | {
|
|
139
|
+
status: 'unavailable';
|
|
140
|
+
reason: string;
|
|
67
141
|
};
|
|
142
|
+
/**
|
|
143
|
+
* PRI-917 Slice 2 — what the reuse gate did before a ledger write.
|
|
144
|
+
*
|
|
145
|
+
* - `not_configured` — no decision function was injected, so no gate ran. This
|
|
146
|
+
* is the current production shape; it is reported rather than assumed, so a
|
|
147
|
+
* caller can never mistake "gate absent" for "gate found nothing".
|
|
148
|
+
* - `no_candidates` — the gate ran and found nothing credible.
|
|
149
|
+
* - `create_decided` — the gate found candidates and the decision function
|
|
150
|
+
* answered `create`; the write proceeded exactly as before.
|
|
151
|
+
* - `recommended_create` (PRI-917 v0.3.3) — the auto-path recommendation hook
|
|
152
|
+
* ran and did NOT answer reuse (create / uncertain / unavailable / selection
|
|
153
|
+
* outside the proposal); the write proceeded per Rules 2-4. Never emitted
|
|
154
|
+
* when only an Owner decision function is configured.
|
|
155
|
+
*/
|
|
156
|
+
export type ReuseCheckOutcome = 'not_configured' | 'no_candidates' | 'create_decided' | 'recommended_create';
|
|
68
157
|
export interface CandidateIntakeServiceOptions {
|
|
69
158
|
stateManager: RuntimeStateManager;
|
|
70
159
|
ledgerAdapter: LedgerAdapter;
|
|
160
|
+
/**
|
|
161
|
+
* PRI-917 Slice 2 — optional reuse decision function.
|
|
162
|
+
*
|
|
163
|
+
* When omitted (the current production shape) the reuse gate does not run
|
|
164
|
+
* and intake behaves exactly as before; the result still reports
|
|
165
|
+
* `reuseCheck: 'not_configured'` so "no gate" is never mistaken for "no
|
|
166
|
+
* duplicate found".
|
|
167
|
+
*
|
|
168
|
+
* Mutually exclusive with reuseRecommendation; supplying both fails at construction.
|
|
169
|
+
* When provided, it receives the bounded proposal and MUST answer `reuse`
|
|
170
|
+
* or `create` — there is no automatic option and no default.
|
|
171
|
+
*/
|
|
172
|
+
reuseDecision?: (proposal: ReuseProposal) => ReuseDecision;
|
|
173
|
+
/** Workspace state dir used for read-only reuse retrieval. */
|
|
174
|
+
reuseStateDir?: string;
|
|
175
|
+
/**
|
|
176
|
+
* PRI-917 v0.3.3 (OD-PRI917-05) — optional auto-path Reuse Review Gate
|
|
177
|
+
* recommendation hook. When injected (WITHOUT `reuseDecision`), the gate
|
|
178
|
+
* runs the semantic evaluation for every candidate with a credible proposal
|
|
179
|
+
* and parks the candidate (`refused/reuse_pending_owner`) when the
|
|
180
|
+
* recommendation is `reuse` with a selection inside the proposal. Any other
|
|
181
|
+
* outcome (create / uncertain / unavailable / throw) degrades to CREATE —
|
|
182
|
+
* evaluation failure must never block learning (Rule 4). The hook is a
|
|
183
|
+
* RECOMMENDATION channel only: it can never write, and it is never injected
|
|
184
|
+
* together with an Owner decision function by production callers.
|
|
185
|
+
*/
|
|
186
|
+
reuseRecommendation?: (claim: ReuseCandidateInput, proposal: ReuseProposal) => Promise<ReuseRecommendationOutcome>;
|
|
71
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* PRI-917 PR3A (surface audit C4): the candidate-semantics extraction shared
|
|
190
|
+
* by BOTH the intake flow (steps 4b/4c) and the `pd candidate review`
|
|
191
|
+
* surface — one implementation, so the retrieval input shown to the Owner can
|
|
192
|
+
* never drift from what intake actually consumes.
|
|
193
|
+
*
|
|
194
|
+
* Resolution order (identical to intake steps 4b→4c):
|
|
195
|
+
* 1. candidate.sourceRecommendationJson — validated directly, then via the
|
|
196
|
+
* diagnostician description→text normalization; malformed JSON warns and
|
|
197
|
+
* falls through (rc-9 observable degradation);
|
|
198
|
+
* 2. artifact.contentJson — the three historical shapes.
|
|
199
|
+
*
|
|
200
|
+
* Pure apart from the rc-9 warn; never throws — failures come back as
|
|
201
|
+
* `{ ok: false, error }` carrying the exact CandidateIntakeError intake
|
|
202
|
+
* itself would throw.
|
|
203
|
+
*/
|
|
204
|
+
export type CandidateRecommendationExtraction = {
|
|
205
|
+
ok: true;
|
|
206
|
+
recommendation: Recommendation;
|
|
207
|
+
} | {
|
|
208
|
+
ok: false;
|
|
209
|
+
error: CandidateIntakeError;
|
|
210
|
+
};
|
|
211
|
+
export declare function extractIntakeRecommendation(candidate: {
|
|
212
|
+
candidateId: string;
|
|
213
|
+
sourceRecommendationJson?: string | null;
|
|
214
|
+
}, artifact: {
|
|
215
|
+
contentJson: string;
|
|
216
|
+
} | null): CandidateRecommendationExtraction;
|
|
72
217
|
export declare class CandidateIntakeService {
|
|
73
218
|
#private;
|
|
74
219
|
constructor(opts: CandidateIntakeServiceOptions);
|
|
@@ -90,5 +235,9 @@ export declare class CandidateIntakeService {
|
|
|
90
235
|
* - LEDGER_WRITE_FAILED when ledger write fails
|
|
91
236
|
*/
|
|
92
237
|
intake(candidateId: string): Promise<CandidateIntakeResult>;
|
|
238
|
+
/** Whether the automatic recommendation channel is configured for read-only review. */
|
|
239
|
+
get reuseReviewEnabled(): boolean;
|
|
240
|
+
/** Uses the same input validation and gate as intake, but never writes. */
|
|
241
|
+
reviewReuse(candidateId: string): Promise<CandidateIntakeResult | null>;
|
|
93
242
|
}
|
|
94
243
|
//# sourceMappingURL=candidate-intake-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-intake-service.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/candidate-intake-service.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"candidate-intake-service.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/candidate-intake-service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACjG,OAAO,EAAE,oBAAoB,EAAwD,MAAM,uBAAuB,CAAC;AACnH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAQ5E,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACxF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE;;;;;;;;;;;;;;;;;;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