create-principles-disciple 1.134.6 → 1.134.7
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/console/dist/server/routes/update.js +27 -15
- package/console/dist/server/utils/gateway.d.ts +4 -0
- package/console/dist/server/utils/gateway.js +24 -4
- package/console/dist/ui/pages/settings/UpdatePage.js +5 -3
- package/console/dist/ui/utils/validators.d.ts +2 -0
- package/console/dist/ui/utils/validators.js +3 -0
- package/console/dist/web/assets/app.js +11 -5
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js +107 -1
- package/core/dist/runtime-v2/__tests__/resolve-runtime-config-from-pd-config.test.js.map +1 -1
- package/core/dist/runtime-v2/index.d.ts +1 -1
- package/core/dist/runtime-v2/index.d.ts.map +1 -1
- package/core/dist/runtime-v2/index.js +1 -1
- package/core/dist/runtime-v2/index.js.map +1 -1
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.pri717.test.d.ts +26 -0
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.pri717.test.d.ts.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.pri717.test.js +420 -0
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.pri717.test.js.map +1 -0
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js +6 -1
- package/core/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js.map +1 -1
- package/core/dist/runtime-v2/internalization/candidate-lineage.d.ts +50 -1
- package/core/dist/runtime-v2/internalization/candidate-lineage.d.ts.map +1 -1
- package/core/dist/runtime-v2/internalization/candidate-lineage.js +204 -77
- package/core/dist/runtime-v2/internalization/candidate-lineage.js.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +41 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js +59 -9
- package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
- package/core/package.json +1 -1
- package/host-runtime/dist/internalization-consumer-cycle.js +71 -23
- package/host-runtime/package.json +1 -1
- package/package.json +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/pd-cli/dist/commands/runtime-internalization-run-once.js +23 -7
- package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.js +4 -1
- package/pd-cli/dist/services/__tests__/runtime-adapter-resolver.test.js.map +1 -1
- package/pd-cli/dist/services/resolve-runtime-from-pd-config.d.ts +28 -2
- 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 +19 -6
- package/pd-cli/dist/services/resolve-runtime-from-pd-config.js.map +1 -1
- package/pd-cli/dist/services/rulehost-readiness.js +1 -1
- package/pd-cli/dist/services/rulehost-readiness.js.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.d.ts +14 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.js +4 -1
- package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -1
- package/pd-cli/package.json +1 -1
- package/plugin/dist/bundle.js +515 -515
- package/plugin/dist/governance-audit.js +1 -1
- package/plugin/dist/rulehost-evidence.js +1 -1
- package/release-manager/package.json +1 -1
|
@@ -15,6 +15,13 @@
|
|
|
15
15
|
* limit / cycle) → `ok: true` with a partial chain + notes; `complete` is
|
|
16
16
|
* false and `notes` is non-empty.
|
|
17
17
|
*
|
|
18
|
+
* Stale-instance rebind (PRI-717): a lineage edge whose artifact id no longer
|
|
19
|
+
* resolves is first checked against the producer-task convention
|
|
20
|
+
* (`pi-art-<taskId>-run_<taskId>_<seq>`); when the producing task still has a
|
|
21
|
+
* current durable artifact, the edge resolves to it and a
|
|
22
|
+
* `lineage_edge_rebound` event is emitted. Everything else stays fail-closed
|
|
23
|
+
* `ancestor_pruned`.
|
|
24
|
+
*
|
|
18
25
|
* Request-scoped cache: a single `CandidateLineage` instance lives for one
|
|
19
26
|
* `buildContext`; repeated `getArtifactById` calls for the same id hit the
|
|
20
27
|
* cache, not the store (CP-18).
|
|
@@ -79,6 +86,21 @@ export type LineageEvent = {
|
|
|
79
86
|
readonly artifactId: string;
|
|
80
87
|
readonly noteCode: LineageNoteCode;
|
|
81
88
|
readonly detail: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A lineage edge referenced a superseded artifact INSTANCE id and was
|
|
92
|
+
* resolved to the producer task's CURRENT artifact (PRI-717). Durable
|
|
93
|
+
* artifact ids embed the producing run (`pi-art-<taskId>-run_<taskId>_<seq>`)
|
|
94
|
+
* and the upsert rewrites the id on every re-run of the same task, so edges
|
|
95
|
+
* captured before an upstream revision dangle even though the logical
|
|
96
|
+
* artifact (UNIQUE(source_task_id, artifact_kind)) still exists. Emitted so
|
|
97
|
+
* the rebind stays observable (rc-9) — it is not a partial-chain note.
|
|
98
|
+
*/
|
|
99
|
+
| {
|
|
100
|
+
readonly type: 'lineage_edge_rebound';
|
|
101
|
+
readonly staleArtifactId: string;
|
|
102
|
+
readonly resolvedArtifactId: string;
|
|
103
|
+
readonly taskId: string;
|
|
82
104
|
};
|
|
83
105
|
/** Two-hop task reader (F1) — resolves taskKind from a taskId. */
|
|
84
106
|
export interface LineageTaskReader {
|
|
@@ -88,7 +110,7 @@ export interface LineageTaskReader {
|
|
|
88
110
|
} | null>;
|
|
89
111
|
}
|
|
90
112
|
export interface CandidateLineageDeps {
|
|
91
|
-
readonly artifacts: Pick<PIArtifactStore, 'getArtifactById'>;
|
|
113
|
+
readonly artifacts: Pick<PIArtifactStore, 'getArtifactById' | 'listBySourceTaskId'>;
|
|
92
114
|
readonly tasks: LineageTaskReader;
|
|
93
115
|
/** Default 6 (longest pipeline chain + 1). */
|
|
94
116
|
readonly maxDepth?: number;
|
|
@@ -126,8 +148,35 @@ export declare class CandidateLineage {
|
|
|
126
148
|
* Iterative BFS resolution with cycle detection (via `visited`) and depth
|
|
127
149
|
* limiting. `visited` carries artifactIds already resolved (prevents cycles
|
|
128
150
|
* and redundant fetches across the whole traversal, not just one path).
|
|
151
|
+
*
|
|
152
|
+
* Depth counts BFS LEVELS (start = level 0), matching the documented
|
|
153
|
+
* `maxDepth = longest pipeline chain + 1` invariant — not the number of
|
|
154
|
+
* nodes processed. A node-counting loop would stop mid-level on wide chains
|
|
155
|
+
* (the split-diagnostician router fans out to two artifacts per level) and
|
|
156
|
+
* starve deep ancestors of resolution (PRI-717).
|
|
129
157
|
*/
|
|
130
158
|
private resolveChain;
|
|
159
|
+
/**
|
|
160
|
+
* PRI-717: attempt to resolve a dangling lineage edge to the producer
|
|
161
|
+
* task's CURRENT artifact. Only fires when the edge id follows the
|
|
162
|
+
* producer convention AND that task still has a durable artifact of the
|
|
163
|
+
* SAME id family; any other outcome keeps the fail-closed
|
|
164
|
+
* `ancestor_pruned` handling in the caller.
|
|
165
|
+
*
|
|
166
|
+
* Review fix (rebind identity): the durable logical identity is
|
|
167
|
+
* (sourceTaskId, artifactKind) — an evaluator task may carry BOTH a
|
|
168
|
+
* `pi-art-…` principle row and a `pi-rule-…` rule row. The stale edge
|
|
169
|
+
* names a `pi-art-` instance of the task, so only the CURRENT instance of
|
|
170
|
+
* the SAME id family is a rebound candidate — never another kind's row
|
|
171
|
+
* and never array order. `matches.length !== 1` (0 = no current instance
|
|
172
|
+
* of this family, >1 = data anomaly against UNIQUE(source_task_id,
|
|
173
|
+
* artifact_kind)) stays fail-closed, with the ambiguity reported back so
|
|
174
|
+
* the caller's note says why — never a silent pick.
|
|
175
|
+
*
|
|
176
|
+
* The rebind result is cached under the STALE id so repeated edges to the
|
|
177
|
+
* same superseded instance stay idempotent within one request (CP-18).
|
|
178
|
+
*/
|
|
179
|
+
private tryReboundInstance;
|
|
131
180
|
/** Cached artifact fetch. Returns `ok:false` on store failure or corruption. */
|
|
132
181
|
private getArtifactCached;
|
|
133
182
|
/** Cached task fetch (two-hop). Returns `ok:false` only on reader failure (treated as store_failure). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-lineage.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/candidate-lineage.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"candidate-lineage.d.ts","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/candidate-lineage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAoB,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAKhF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACnD,sDAAsD;IACtD,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,eAAe,CAAC;CACpC;AAED,MAAM,MAAM,eAAe,GACvB,sBAAsB,GACtB,iBAAiB,GACjB,cAAc,GACd,qBAAqB,GACrB,gBAAgB,CAAC;AAErB,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,oDAAoD;IACpD,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAC;IACvC,qDAAqD;IACrD,QAAQ,CAAC,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AE7D;IAED;;;;OAIG;IACG,sBAAsB,CAC1B,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,GACf,OAAO,CACN;QAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,CAAA;KAAE,GAChG;QAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;KAAE,CACvD,CAKA;IAID;;;;;;;;;;OAUG;YACW,YAAY;IAyI1B;;;;;;;;;;;;;;;;;;;OAmBG;YACW,kBAAkB;IAgChC,gFAAgF;YAClE,iBAAiB;IAiB/B,yGAAyG;YAC3F,aAAa;CAgB5B"}
|
|
@@ -15,6 +15,13 @@
|
|
|
15
15
|
* limit / cycle) → `ok: true` with a partial chain + notes; `complete` is
|
|
16
16
|
* false and `notes` is non-empty.
|
|
17
17
|
*
|
|
18
|
+
* Stale-instance rebind (PRI-717): a lineage edge whose artifact id no longer
|
|
19
|
+
* resolves is first checked against the producer-task convention
|
|
20
|
+
* (`pi-art-<taskId>-run_<taskId>_<seq>`); when the producing task still has a
|
|
21
|
+
* current durable artifact, the edge resolves to it and a
|
|
22
|
+
* `lineage_edge_rebound` event is emitted. Everything else stays fail-closed
|
|
23
|
+
* `ancestor_pruned`.
|
|
24
|
+
*
|
|
18
25
|
* Request-scoped cache: a single `CandidateLineage` instance lives for one
|
|
19
26
|
* `buildContext`; repeated `getArtifactById` calls for the same id hit the
|
|
20
27
|
* cache, not the store (CP-18).
|
|
@@ -24,6 +31,35 @@
|
|
|
24
31
|
import { SUMMARY_RUNNER_KINDS } from './artifact-summary.js';
|
|
25
32
|
// ── Helpers ──────────────────────────────────────────────────────────────────
|
|
26
33
|
const DEFAULT_MAX_DEPTH = 6;
|
|
34
|
+
const ARTIFACT_ID_PREFIX = 'pi-art-';
|
|
35
|
+
const RUN_MARKER = '-run_';
|
|
36
|
+
/**
|
|
37
|
+
* Recover the producing task id from a durable artifact INSTANCE id
|
|
38
|
+
* (`pi-art-<taskId>-run_<taskId>_<seq>` — the run id embeds its own task id).
|
|
39
|
+
*
|
|
40
|
+
* Returns null when the id does not follow the producer convention (foreign
|
|
41
|
+
* shape, mismatched run segment, non-numeric sequence); the caller then keeps
|
|
42
|
+
* the fail-closed `ancestor_pruned` path — a non-parseable edge is never
|
|
43
|
+
* silently rebound to a guessed task.
|
|
44
|
+
*/
|
|
45
|
+
function parseArtifactInstanceTaskId(artifactId) {
|
|
46
|
+
if (!artifactId.startsWith(ARTIFACT_ID_PREFIX))
|
|
47
|
+
return null;
|
|
48
|
+
const markerIdx = artifactId.lastIndexOf(RUN_MARKER);
|
|
49
|
+
if (markerIdx <= ARTIFACT_ID_PREFIX.length)
|
|
50
|
+
return null;
|
|
51
|
+
const taskId = artifactId.slice(ARTIFACT_ID_PREFIX.length, markerIdx);
|
|
52
|
+
if (taskId === '')
|
|
53
|
+
return null;
|
|
54
|
+
// The run segment after the marker must be `run_<taskId>_<digits>` for the
|
|
55
|
+
// same taskId — a mismatch means the id is not a producer-convention id.
|
|
56
|
+
const runSegment = artifactId.slice(markerIdx + 1 + 'run_'.length);
|
|
57
|
+
const expectedRunPrefix = `${taskId}_`;
|
|
58
|
+
if (!runSegment.startsWith(expectedRunPrefix))
|
|
59
|
+
return null;
|
|
60
|
+
const seq = runSegment.slice(expectedRunPrefix.length);
|
|
61
|
+
return /^(0|[1-9][0-9]*)$/.test(seq) ? taskId : null;
|
|
62
|
+
}
|
|
27
63
|
function isRecord(value) {
|
|
28
64
|
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
29
65
|
}
|
|
@@ -100,100 +136,191 @@ export class CandidateLineage {
|
|
|
100
136
|
* Iterative BFS resolution with cycle detection (via `visited`) and depth
|
|
101
137
|
* limiting. `visited` carries artifactIds already resolved (prevents cycles
|
|
102
138
|
* and redundant fetches across the whole traversal, not just one path).
|
|
139
|
+
*
|
|
140
|
+
* Depth counts BFS LEVELS (start = level 0), matching the documented
|
|
141
|
+
* `maxDepth = longest pipeline chain + 1` invariant — not the number of
|
|
142
|
+
* nodes processed. A node-counting loop would stop mid-level on wide chains
|
|
143
|
+
* (the split-diagnostician router fans out to two artifacts per level) and
|
|
144
|
+
* starve deep ancestors of resolution (PRI-717).
|
|
103
145
|
*/
|
|
104
146
|
async resolveChain(startArtifactId, visited) {
|
|
105
147
|
const nodes = [];
|
|
106
148
|
const notes = [];
|
|
149
|
+
// Resolved (post-rebind) artifact ids already emitted as nodes. Distinct
|
|
150
|
+
// edge ids — one stale instance, one current — can resolve to the SAME
|
|
151
|
+
// logical artifact when siblings were written across an upstream
|
|
152
|
+
// revision; the second resolution must be a silent skip, not a duplicate
|
|
153
|
+
// node or a spurious cycle note.
|
|
154
|
+
const seenResolvedIds = new Set();
|
|
107
155
|
// BFS-style frontier of artifact ids to resolve, seeded with the start.
|
|
108
|
-
//
|
|
156
|
+
// Each iteration drains one full LEVEL, then the frontier's next level is
|
|
157
|
+
// the artifacts discovered by that drain.
|
|
109
158
|
const queue = [startArtifactId];
|
|
110
|
-
let
|
|
159
|
+
let level = 0;
|
|
111
160
|
while (queue.length > 0) {
|
|
112
|
-
|
|
161
|
+
// NOTE: a re-queued already-visited id (fan-in diamond — the EP002
|
|
162
|
+
// router topology) is diagnosed as `cycle_detected` when popped. That
|
|
163
|
+
// is the pre-existing diagnostic contract (a true lineage cycle is
|
|
164
|
+
// indistinguishable from a diamond without creation-time ordering);
|
|
165
|
+
// `complete` is advisory only — production consumers gate on `ok` and
|
|
166
|
+
// node reachability, not on `complete`.
|
|
167
|
+
if (level >= this.maxDepth) {
|
|
113
168
|
const [last] = queue;
|
|
114
169
|
notes.push({ code: 'depth_limit_reached', artifactId: last ?? startArtifactId, detail: `maxDepth (${this.maxDepth}) reached; remaining ${queue.length} ancestor(s) not traversed` });
|
|
115
170
|
this.emit({ type: 'lineage_partial', artifactId: last ?? startArtifactId, noteCode: 'depth_limit_reached', detail: `maxDepth ${this.maxDepth}` });
|
|
116
171
|
break;
|
|
117
172
|
}
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
(
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
: '
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
173
|
+
const levelSize = queue.length;
|
|
174
|
+
for (let i = 0; i < levelSize; i++) {
|
|
175
|
+
const artifactId = queue.shift();
|
|
176
|
+
if (artifactId === undefined)
|
|
177
|
+
break;
|
|
178
|
+
// Cycle detection.
|
|
179
|
+
if (visited.has(artifactId)) {
|
|
180
|
+
notes.push({ code: 'cycle_detected', artifactId, detail: `artifact ${artifactId} already on the resolution path` });
|
|
181
|
+
this.emit({ type: 'lineage_partial', artifactId, noteCode: 'cycle_detected', detail: 'cycle detected' });
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
visited.add(artifactId);
|
|
185
|
+
// Fetch artifact (cached).
|
|
186
|
+
const artifactResult = await this.getArtifactCached(artifactId);
|
|
187
|
+
if (!artifactResult.ok)
|
|
188
|
+
return artifactResult; // propagate corruption / store failure
|
|
189
|
+
let artifact = artifactResult.value;
|
|
190
|
+
if (artifact === null) {
|
|
191
|
+
// Ancestor referenced but pruned — expected, partial. PRI-717: the
|
|
192
|
+
// edge may reference a superseded INSTANCE id of a task whose
|
|
193
|
+
// logical artifact still exists (id embeds the run; upsert rewrites
|
|
194
|
+
// it on re-run). Attempt one observable rebind before giving up.
|
|
195
|
+
const rebound = await this.tryReboundInstance(artifactId);
|
|
196
|
+
if (!rebound.ok)
|
|
197
|
+
return rebound;
|
|
198
|
+
artifact = rebound.value;
|
|
199
|
+
if (artifact === null) {
|
|
200
|
+
notes.push({
|
|
201
|
+
code: 'ancestor_pruned',
|
|
202
|
+
artifactId,
|
|
203
|
+
detail: rebound.ambiguousCandidates !== undefined
|
|
204
|
+
? `ancestor artifact ${artifactId} not rebound: ambiguous current artifacts for source task (${rebound.ambiguousCandidates} same-family candidates) — refusing to pick by array order`
|
|
205
|
+
: `ancestor artifact ${artifactId} not found (pruned)`,
|
|
206
|
+
});
|
|
207
|
+
this.emit({ type: 'lineage_partial', artifactId, noteCode: 'ancestor_pruned', detail: 'artifact not found' });
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (seenResolvedIds.has(artifact.artifactId))
|
|
212
|
+
continue;
|
|
213
|
+
seenResolvedIds.add(artifact.artifactId);
|
|
214
|
+
// Parse contentJson (rc-1: stays unknown on success; unparseable = corruption).
|
|
215
|
+
let contentJson;
|
|
216
|
+
try {
|
|
217
|
+
contentJson = JSON.parse(artifact.contentJson);
|
|
218
|
+
}
|
|
219
|
+
catch {
|
|
220
|
+
const err = { kind: 'content_json_unparseable', artifactId, detail: `contentJson of ${artifactId} is not valid JSON` };
|
|
221
|
+
this.emit({ type: 'lineage_data_corrupt', artifactId, detail: err.detail, errorKind: 'content_json_unparseable' });
|
|
222
|
+
return { ok: false, error: err };
|
|
223
|
+
}
|
|
224
|
+
// Shape check: must have sourceTaskId (rc-3 fail loud on corruption).
|
|
225
|
+
if (typeof artifact.sourceTaskId !== 'string' || artifact.sourceTaskId === '') {
|
|
226
|
+
const err = { kind: 'artifact_shape_invalid', artifactId, detail: `artifact ${artifactId} missing required sourceTaskId` };
|
|
227
|
+
this.emit({ type: 'lineage_data_corrupt', artifactId, detail: err.detail, errorKind: 'artifact_shape_invalid' });
|
|
228
|
+
return { ok: false, error: err };
|
|
229
|
+
}
|
|
230
|
+
// Two-hop: sourceTaskId → task.taskKind (F1).
|
|
231
|
+
const taskResult = await this.getTaskCached(artifact.sourceTaskId);
|
|
232
|
+
if (!taskResult.ok)
|
|
233
|
+
return taskResult;
|
|
234
|
+
const task = taskResult.value;
|
|
235
|
+
let taskKind;
|
|
236
|
+
let runnerKind;
|
|
237
|
+
if (task === null) {
|
|
238
|
+
taskKind = 'unknown';
|
|
239
|
+
runnerKind = 'unknown';
|
|
240
|
+
notes.push({ code: 'task_missing', artifactId, detail: `task ${artifact.sourceTaskId} not found; cannot determine stage via two-hop` });
|
|
241
|
+
this.emit({ type: 'lineage_partial', artifactId, noteCode: 'task_missing', detail: `task ${artifact.sourceTaskId} missing` });
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
({ taskKind } = task);
|
|
245
|
+
runnerKind = SUMMARY_RUNNER_KINDS.includes(taskKind)
|
|
246
|
+
? taskKind
|
|
247
|
+
: 'unknown';
|
|
248
|
+
}
|
|
249
|
+
const node = {
|
|
250
|
+
// On a rebind the node carries the RESOLVED artifact's identity, not
|
|
251
|
+
// the superseded edge id — downstream stage attribution reads these.
|
|
252
|
+
artifactId: artifact.artifactId,
|
|
253
|
+
taskId: artifact.sourceTaskId,
|
|
254
|
+
taskKind,
|
|
255
|
+
runnerKind,
|
|
256
|
+
contentJson,
|
|
257
|
+
summary: readSummary(contentJson),
|
|
258
|
+
};
|
|
259
|
+
nodes.push(node);
|
|
260
|
+
// Extend frontier with lineage ids (ancestry).
|
|
261
|
+
const lineageIds = Array.isArray(artifact.lineageArtifactIds) ? artifact.lineageArtifactIds : [];
|
|
262
|
+
if (lineageIds.length === 0 && nodes.length === 1) {
|
|
263
|
+
// The start node has no ancestry — not an error, just a short chain.
|
|
264
|
+
}
|
|
265
|
+
for (const id of lineageIds) {
|
|
266
|
+
if (typeof id === 'string' && id !== '') {
|
|
267
|
+
queue.push(id);
|
|
268
|
+
}
|
|
191
269
|
}
|
|
192
270
|
}
|
|
193
|
-
|
|
271
|
+
level++;
|
|
194
272
|
}
|
|
195
273
|
return { ok: true, value: { nodes, complete: notes.length === 0, notes } };
|
|
196
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* PRI-717: attempt to resolve a dangling lineage edge to the producer
|
|
277
|
+
* task's CURRENT artifact. Only fires when the edge id follows the
|
|
278
|
+
* producer convention AND that task still has a durable artifact of the
|
|
279
|
+
* SAME id family; any other outcome keeps the fail-closed
|
|
280
|
+
* `ancestor_pruned` handling in the caller.
|
|
281
|
+
*
|
|
282
|
+
* Review fix (rebind identity): the durable logical identity is
|
|
283
|
+
* (sourceTaskId, artifactKind) — an evaluator task may carry BOTH a
|
|
284
|
+
* `pi-art-…` principle row and a `pi-rule-…` rule row. The stale edge
|
|
285
|
+
* names a `pi-art-` instance of the task, so only the CURRENT instance of
|
|
286
|
+
* the SAME id family is a rebound candidate — never another kind's row
|
|
287
|
+
* and never array order. `matches.length !== 1` (0 = no current instance
|
|
288
|
+
* of this family, >1 = data anomaly against UNIQUE(source_task_id,
|
|
289
|
+
* artifact_kind)) stays fail-closed, with the ambiguity reported back so
|
|
290
|
+
* the caller's note says why — never a silent pick.
|
|
291
|
+
*
|
|
292
|
+
* The rebind result is cached under the STALE id so repeated edges to the
|
|
293
|
+
* same superseded instance stay idempotent within one request (CP-18).
|
|
294
|
+
*/
|
|
295
|
+
async tryReboundInstance(staleArtifactId) {
|
|
296
|
+
const taskId = parseArtifactInstanceTaskId(staleArtifactId);
|
|
297
|
+
if (taskId === null)
|
|
298
|
+
return { ok: true, value: null };
|
|
299
|
+
try {
|
|
300
|
+
const candidates = await this.artifacts.listBySourceTaskId(taskId);
|
|
301
|
+
const instancePrefix = `${ARTIFACT_ID_PREFIX}${taskId}-run_`;
|
|
302
|
+
const matches = candidates.filter((candidate) => candidate.artifactId.startsWith(instancePrefix));
|
|
303
|
+
if (matches.length !== 1) {
|
|
304
|
+
return { ok: true, value: null, ...(matches.length > 1 ? { ambiguousCandidates: matches.length } : {}) };
|
|
305
|
+
}
|
|
306
|
+
const [resolved] = matches;
|
|
307
|
+
if (resolved === undefined)
|
|
308
|
+
return { ok: true, value: null };
|
|
309
|
+
this.cache.set(staleArtifactId, resolved);
|
|
310
|
+
this.emit({
|
|
311
|
+
type: 'lineage_edge_rebound',
|
|
312
|
+
staleArtifactId,
|
|
313
|
+
resolvedArtifactId: resolved.artifactId,
|
|
314
|
+
taskId,
|
|
315
|
+
});
|
|
316
|
+
return { ok: true, value: resolved };
|
|
317
|
+
}
|
|
318
|
+
catch (storeErr) {
|
|
319
|
+
const err = { kind: 'store_failure', detail: storeErr instanceof Error ? storeErr.message : String(storeErr) };
|
|
320
|
+
this.emit({ type: 'lineage_store_failure', detail: err.detail });
|
|
321
|
+
return { ok: false, error: err };
|
|
322
|
+
}
|
|
323
|
+
}
|
|
197
324
|
/** Cached artifact fetch. Returns `ok:false` on store failure or corruption. */
|
|
198
325
|
async getArtifactCached(artifactId) {
|
|
199
326
|
if (this.cache.has(artifactId)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-lineage.js","sourceRoot":"","sources":["../../../src/runtime-v2/internalization/candidate-lineage.ts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AS,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;YAC/B,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACjE,CAAC;QACD,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YACjC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACnC,CAAC;QAAC,OAAO,SAAS,EAAE,CAAC;YACnB,MAAM,GAAG,GAAiB,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,SAAS,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC;YAChI,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;YACjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QACnC,CAAC;IACH,CAAC;CACF"}
|
|
@@ -17,7 +17,7 @@ import type { TelemetryEvent } from '../telemetry-event.js';
|
|
|
17
17
|
import type { RuntimeKind } from './runtime-protocol.js';
|
|
18
18
|
import type { LedgerAdapter } from './candidate-intake.js';
|
|
19
19
|
import type { IntentDocReader } from './intent/intent-doc-reader-port.js';
|
|
20
|
-
import type { EffectivePdConfig } from './config/pd-config-types.js';
|
|
20
|
+
import type { EffectivePdConfig, InternalAgentName } from './config/pd-config-types.js';
|
|
21
21
|
export interface PainSignalRuntimeFactoryOptions {
|
|
22
22
|
workspaceDir: string;
|
|
23
23
|
stateDir: string;
|
|
@@ -63,6 +63,12 @@ export interface RuntimeConfig {
|
|
|
63
63
|
baseUrl?: string;
|
|
64
64
|
/** Optional system prompt (flows from profile to PiAiRuntimeAdapter). */
|
|
65
65
|
systemPrompt?: string;
|
|
66
|
+
/**
|
|
67
|
+
* PRI-719: the runtimeProfile id this config was resolved FROM (absent on
|
|
68
|
+
* legacy/CLI-override resolutions). Lets run evidence answer
|
|
69
|
+
* "which declared profile actually executed" without a second lookup.
|
|
70
|
+
*/
|
|
71
|
+
runtimeProfileId?: string;
|
|
66
72
|
}
|
|
67
73
|
export interface RuntimeConfigError {
|
|
68
74
|
ok: false;
|
|
@@ -102,6 +108,40 @@ export declare function resolveRuntimeConfig(stateDir: string, explicitConfig?:
|
|
|
102
108
|
* Includes migration guidance for D-05 breaking change.
|
|
103
109
|
*/
|
|
104
110
|
export declare function validateRuntimeConfig(config: RuntimeConfig): void;
|
|
111
|
+
/**
|
|
112
|
+
* PRI-719: taskKind → internalAgents.agents key for the consumer/run-once
|
|
113
|
+
* peer stages. `rollout_reviewer` maps to the camelCase agent name
|
|
114
|
+
* `rolloutReviewer` (INTERNAL_AGENT_NAMES); diagnostic stages are NOT here —
|
|
115
|
+
* they run through the pain-signal bridge, which owns the diagnostician
|
|
116
|
+
* binding.
|
|
117
|
+
*/
|
|
118
|
+
export declare const AGENT_NAME_FOR_TASK_KIND: Readonly<Record<string, InternalAgentName>>;
|
|
119
|
+
export interface ResolveRuntimeConfigForAgentOptions {
|
|
120
|
+
/** Env var accessor for readiness checks. */
|
|
121
|
+
readonly getEnvVar: (name: string) => string | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* PRI-719: resolve the binding even when the agent is disabled. The
|
|
124
|
+
* consumer's per-stage scope is governed by the internalization_full_chain
|
|
125
|
+
* FLAG, not by internalAgents.agents[kind].enabled — the shipped default
|
|
126
|
+
* config disables philosopher/evaluator/rolloutReviewer yet the full-chain
|
|
127
|
+
* consumer runs them. `enabled` gates the pain-signal bridge
|
|
128
|
+
* (diagnostician). Lifts only the gate, through the SAME binding
|
|
129
|
+
* authority, via a read-only re-enabled view of the config.
|
|
130
|
+
*/
|
|
131
|
+
readonly ignoreAgentEnabled?: boolean;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* PRI-719: per-agent runtime config resolution.
|
|
135
|
+
*
|
|
136
|
+
* Same binding → readiness → adapter-config pipeline as
|
|
137
|
+
* resolveRuntimeConfigFromPdConfig, parameterized by the internal agent name
|
|
138
|
+
* so each peer stage resolves ITS OWN
|
|
139
|
+
* `internalAgents.agents[agent].runtimeProfile` (falling back to
|
|
140
|
+
* defaultRuntime). Consumer/run-once must resolve per leased/selected task
|
|
141
|
+
* kind — sharing one agent's binding across the whole chain silently
|
|
142
|
+
* ignored every other agent's declared profile (EP002-R2 F4).
|
|
143
|
+
*/
|
|
144
|
+
export declare function resolveRuntimeConfigForAgent(effectiveConfig: EffectivePdConfig, agentName: InternalAgentName, options: ResolveRuntimeConfigForAgentOptions): RuntimeConfigResult;
|
|
105
145
|
/**
|
|
106
146
|
* PRI-306: Resolve runtime configuration from EffectivePdConfig.
|
|
107
147
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pain-signal-runtime-factory.d.ts","sourceRoot":"","sources":["../../src/runtime-v2/pain-signal-runtime-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,gBAAgB,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAc9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAStF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,KAAK,EAAE,WAAW,EAAoB,MAAM,uBAAuB,CAAC;AAC3E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAA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