@indexnetwork/protocol 6.10.0-rc.398.1 → 6.10.2-rc.400.1

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/CHANGELOG.md CHANGED
@@ -12,6 +12,9 @@ See [STABILITY.md](./STABILITY.md) for the public-contract and tier definitions.
12
12
 
13
13
  ## [Unreleased]
14
14
 
15
+ ### Fixed
16
+ - Allow the private intent-refinement provenance snapshot to identify intent creation as a producer and make the shared refinement prompt independent of no-opportunity process state, enabling creation and authoritative discovery producers to converge on one ordinary intent-page question cadence.
17
+
15
18
  ### Added
16
19
  - Add the private `recovery` Questioner purpose and one-question intent recovery preset for post-discovery signal refinement (IND-506). The preset receives only the owned intent, global owner context, and an optional bounded aggregate count of fail-closed validated no-opportunity outcomes; it forbids candidate/counterparty/process narration, preserves the existing creation-time intent preset, persists publicly as ordinary `mode='intent'` questions with versioned internal recovery metadata, and carries optional material-fingerprint plus expected-owner guards through answer-only updates so the final database write can recheck lifecycle as well as content.
17
20
  - Add versioned internal negotiation-question provenance and explicit source/candidate opportunity-actor intent threading for ordinary follow-up, inflight consultation, and uptake questions (IND-507). Runtime mode/purpose discriminants, structured `askUser` safety validation, neutral uptake context, and visible-field output gates exclude raw counterparty profile/identity/intent, private transcript, evaluator reasoning, match reasons, event/community inference, evidence, and internal IDs. Exact settlement/task correlation now threads through run-existing continuation admission without changing producer triggers or the ≤2 ordinary/inflight and ≤1 uptake cardinality.
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation.graph.d.ts","sourceRoot":"/","sources":["negotiation/negotiation.graph.ts"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAC/F,OAAO,KAAK,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC9I,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,KAA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;;;;;;;;;GAYG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE;IAC1C,SAAS,EAAE,oBAAoB,CAAC;IAChC,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACnC,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,OAAO,EAAE,kBAAkB,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,4CAA4C,EAAE,8BAA8B,CAAC;CAC3G,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpB;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,gBAAgB,EAAE,oBAAoB,EACtC,UAAU,EAAE,sBAAsB,EAClC,UAAU,EAAE,oBAAoB,EAAE,EAClC,YAAY,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACnD,IAAI,CAAC,EAAE;IACL,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,qBAAqB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB,CAAC,EAAE,qBAAqB,CAAC;IAC5C,OAAO,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACrC;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kFAAkF;IAClF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iEAAiE;IACjE,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,yEAAyE;IACzE,qBAAqB,CAAC,EAAE,OAAO,4CAA4C,EAAE,gCAAgC,CAAC;CAC/G,GACA,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA2K9B"}
@@ -216,10 +216,9 @@ export class NegotiationGraphFactory {
216
216
  return typeof v === 'string' && v.length > 0 ? v : null;
217
217
  };
218
218
  let initiatorUserId = readInitiator(priorTask?.metadata) ?? state.initiatorUserId ?? state.sourceUser.id;
219
- // Conversation-scoped prior task: reused for both the initiator tie-break
220
- // (only when active+fresh) and protocol-version inheritance (any prior
221
- // task on the conversation pins the version).
222
- const convTask = !exactContinuation && (!readInitiator(priorTask?.metadata) || !readProtocolVersion(priorTask?.metadata))
219
+ // Conversation-scoped prior task: used only for the initiator tie-break
220
+ // (and only when active+fresh).
221
+ const convTask = !exactContinuation && !readInitiator(priorTask?.metadata)
223
222
  ? await database.getLatestNegotiationTaskForConversation?.(conversation.id).catch(() => null)
224
223
  : null;
225
224
  if (!readInitiator(priorTask?.metadata)) {
@@ -235,24 +234,18 @@ export class NegotiationGraphFactory {
235
234
  }
236
235
  }
237
236
  }
238
- // --- Protocol version: inherited, never re-stamped ---
239
- // Every session (including continuations) creates a new task row, so a
240
- // naïve "stamp from env at init" would flip a v1 conversation to v2
241
- // mid-flight. Rule: any prior negotiation task on this conversation pins
242
- // the version (absent field on a genuine prior = pre-v2 task = v1);
243
- // prior turns without a readable task also grandfather to v1; only
244
- // genuinely fresh negotiations stamp from NEGOTIATION_PROTOCOL_VERSION.
245
- let protocolVersion;
246
- const priorVersionSource = priorTask ?? convTask;
247
- if (priorVersionSource) {
248
- protocolVersion = readProtocolVersion(priorVersionSource.metadata) ?? 'v1';
249
- }
250
- else if (isContinuation) {
251
- protocolVersion = 'v1';
252
- }
253
- else {
254
- protocolVersion = configuredProtocolVersion();
255
- }
237
+ // --- Protocol version: pinned per negotiation, re-stamped per match ---
238
+ // A prior task for this same negotiation (exact continuation resume or
239
+ // a re-run of the same opportunity) pins the version, so one
240
+ // negotiation never flips semantics mid-flight (absent field on a
241
+ // genuine prior = pre-v2 task = v1). Everything else — including
242
+ // continuations of older conversations between the same pair stamps
243
+ // fresh from NEGOTIATION_PROTOCOL_VERSION, so a version cutover
244
+ // reaches existing pairs on their next new match instead of being
245
+ // pinned to v1 forever by conversation history.
246
+ const protocolVersion = priorTask
247
+ ? (readProtocolVersion(priorTask.metadata) ?? 'v1')
248
+ : configuredProtocolVersion();
256
249
  const taskMetadata = {
257
250
  type: 'negotiation',
258
251
  sourceUserId: state.sourceUser.id,