@indexnetwork/protocol 22.0.0-rc.497.1 → 22.0.0-rc.499.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/dist/index.d.ts CHANGED
@@ -127,6 +127,8 @@ export { isNegotiationTurnCapReached, expectedNegotiationSpeaker, negotiationSco
127
127
  export type { NegotiationSpeakerParticipants, NegotiationSpeakerMessage, NegotiationScopeMetadata } from "./negotiations/negotiation.module.js";
128
128
  export { assessConsultationEligibility, consultationPromptFor, negotiationConsultationPolicyMode } from "./negotiations/negotiation.module.js";
129
129
  export type { ConsultationEligibility, ConsultationEligibilityInput, NegotiationConsultationPolicyMode } from "./negotiations/negotiation.module.js";
130
+ export { countOpenPreContactConsults } from "./negotiations/negotiation.module.js";
131
+ export type { PreContactConsultTaskRow } from "./negotiations/negotiation.module.js";
130
132
  export { NEGOTIATION_QUESTION_GENERIC_COUNTERPARTY, NEGOTIATION_QUESTION_GENERIC_NETWORK, negotiationQuestionSettlementId, } from "./negotiations/negotiation.module.js";
131
133
  export { classifyParkedNegotiation, consumeQuestionBlockAnswers, negotiationParkAnswerId, resumeParkedNegotiation, routeAnswerRef, } from "./negotiations/negotiation.module.js";
132
134
  export type { AnswerRoute, InflightAnswerSettlementInput, InflightAnswerSettlementResult, NegotiationAnswerConsumptionPorts, NegotiationAnswerInput, NegotiationAnswerResumeOutcome, ParkClassification, QuestionBlockAnswerConsumptionInput, QuestionBlockAnswerConsumptionResult, RoutedAnswer, } from "./negotiations/negotiation.module.js";
package/dist/index.js CHANGED
@@ -113,6 +113,11 @@ export { HERMES_OWNER_DIRECTIVE, HermesNegotiationResponseSchema, allowedHermesA
113
113
  // ─── Negotiation seat rules (v2 client-advocate protocol) ───────────────────
114
114
  export { isNegotiationTurnCapReached, expectedNegotiationSpeaker, negotiationScopeKey, readNegotiationMessages, allowedActionsFor, askUserAnswerWindowMs, configuredAskUserEnabled, isTerminalAction, isRejectLikeAction, readProtocolVersion, resolveSeat, seatViolationMessage } from "./negotiations/negotiation.module.js";
115
115
  export { assessConsultationEligibility, consultationPromptFor, negotiationConsultationPolicyMode } from "./negotiations/negotiation.module.js";
116
+ // The pre-contact park predicate (#1445), re-exported for the radar read path:
117
+ // the "asking you first" state is the same open-consult recognition the
118
+ // per-signal cap performs, so both sides must read the stamp through one
119
+ // function rather than two copies of the same JSON walk.
120
+ export { countOpenPreContactConsults } from "./negotiations/negotiation.module.js";
116
121
  export { NEGOTIATION_QUESTION_GENERIC_COUNTERPARTY, NEGOTIATION_QUESTION_GENERIC_NETWORK, negotiationQuestionSettlementId, } from "./negotiations/negotiation.module.js";
117
122
  // ─── Negotiation answer consumption (conversational questions) ──────────────
118
123
  export { classifyParkedNegotiation, consumeQuestionBlockAnswers, negotiationParkAnswerId, resumeParkedNegotiation, routeAnswerRef, } from "./negotiations/negotiation.module.js";
@@ -23,10 +23,10 @@ export { HERMES_OWNER_DIRECTIVE, HERMES_SHARED_MESSAGE_TEMPLATES, HermesNegotiat
23
23
  export { DEFAULT_NEGOTIATION_MAX_TURNS, isNegotiationTurnCapReached } from "./negotiation.turn-cap.js";
24
24
  export { expectedNegotiationSpeaker } from "./negotiation.expected-speaker.js";
25
25
  export { negotiationScopeKey, readNegotiationMessages } from "./negotiation.scope.js";
26
- export { assessConsultationEligibility, consultationPromptFor, negotiationConsultationPolicyMode, } from "./negotiation.consultation-policy.js";
26
+ export { assessConsultationEligibility, consultationPromptFor, countOpenPreContactConsults, negotiationConsultationPolicyMode, } from "./negotiation.consultation-policy.js";
27
27
  export { NEGOTIATION_QUESTION_GENERIC_COUNTERPARTY, NEGOTIATION_QUESTION_GENERIC_NETWORK, isSafeAuthoredNegotiationQuestion, isSafeNegotiationQuestionText, negotiationQuestionSettlementId, validateInflightAskUserFields, } from "./negotiation.question-safety.js";
28
28
  export { renderNegotiatorChatMemorySection } from "./negotiation.memory.js";
29
- export type { ConsultationEligibility, ConsultationEligibilityInput, NegotiationConsultationPolicyMode, NegotiationConsultationReason, } from "./negotiation.consultation-policy.js";
29
+ export type { ConsultationEligibility, ConsultationEligibilityInput, NegotiationConsultationPolicyMode, NegotiationConsultationReason, PreContactConsultTaskRow, } from "./negotiation.consultation-policy.js";
30
30
  export type { HermesNegotiationAction, HermesNegotiationResponse, HermesOwnerDirective, HermesRoleAlignment, } from "./negotiation.hermes-contract.js";
31
31
  export type { NegotiationGraphLike, NegotiationOutcome, NegotiationTurn, UserNegotiationContext, } from "./negotiation.state.js";
32
32
  export type { NegotiationSpeakerMessage, NegotiationSpeakerParticipants } from "./negotiation.expected-speaker.js";
@@ -18,6 +18,6 @@ export { HERMES_OWNER_DIRECTIVE, HERMES_SHARED_MESSAGE_TEMPLATES, HermesNegotiat
18
18
  export { DEFAULT_NEGOTIATION_MAX_TURNS, isNegotiationTurnCapReached } from "./negotiation.turn-cap.js";
19
19
  export { expectedNegotiationSpeaker } from "./negotiation.expected-speaker.js";
20
20
  export { negotiationScopeKey, readNegotiationMessages } from "./negotiation.scope.js";
21
- export { assessConsultationEligibility, consultationPromptFor, negotiationConsultationPolicyMode, } from "./negotiation.consultation-policy.js";
21
+ export { assessConsultationEligibility, consultationPromptFor, countOpenPreContactConsults, negotiationConsultationPolicyMode, } from "./negotiation.consultation-policy.js";
22
22
  export { NEGOTIATION_QUESTION_GENERIC_COUNTERPARTY, NEGOTIATION_QUESTION_GENERIC_NETWORK, isSafeAuthoredNegotiationQuestion, isSafeNegotiationQuestionText, negotiationQuestionSettlementId, validateInflightAskUserFields, } from "./negotiation.question-safety.js";
23
23
  export { renderNegotiatorChatMemorySection } from "./negotiation.memory.js";
@@ -9,11 +9,11 @@
9
9
  *
10
10
  * `NEGOTIATOR_STANCE` makes that stance configurable instead of hard-coded:
11
11
  *
12
- * | stance | framing | value bar | query rule | consult propensity | responder check | deadlock |
13
- * |-------------|--------------------------------------|------------------|-------------------------|-------------------------|--------------------------|-----------|
14
- * | `advocate` | argue the case (today) | none | mandate (today) | none (today) | none (today) | bargain |
15
- * | `evaluator` | assess first, advocate if it survives | opportunity-cost | necessary-not-sufficient| prefer over assumption | verify the opening | bargain |
16
- * | `skeptic` | + "most matches are not worth making" | opportunity-cost | necessary-not-sufficient| + unverified = don't proceed | + probe before accepting | stalemate |
12
+ * | stance | framing | value bar | query rule | consult propensity | evidence provenance | responder check | deadlock |
13
+ * |-------------|--------------------------------------|------------------|-------------------------|-------------------------|--------------------------|--------------------------|-----------|
14
+ * | `advocate` | argue the case (today) | none | mandate (today) | none (today) | none (today) | none (today) | bargain |
15
+ * | `evaluator` | assess first, advocate if it survives | opportunity-cost | necessary-not-sufficient| prefer over assumption | own record ≠ client's evidence | verify the opening | bargain |
16
+ * | `skeptic` | + "most matches are not worth making" | opportunity-cost | necessary-not-sufficient| + unverified = don't proceed | (same — no sharpening) | + probe before accepting | stalemate |
17
17
  *
18
18
  * Design constraints (hard):
19
19
  * - **`advocate` is byte-identical.** Every fragment below is additive and
@@ -43,6 +43,12 @@
43
43
  * renders them only there. They still name no action and no mechanism, so the
44
44
  * seat's own rules and the graph's grants stay the sole authority on what this
45
45
  * turn may actually do.
46
+ *
47
+ * The seat parameter is a scoping tool, not a licence to fork: a duty both
48
+ * seats hold stays in the shared prefix even when the failure that motivated it
49
+ * showed up on one seat. `EVIDENCE_PROVENANCE_RULE` is the case in point — it
50
+ * was written for a responder accept, and it renders seat-blind, because an
51
+ * initiator can cite its own prior openings' claims exactly as readily.
46
52
  */
47
53
  import type { NegotiationSeat } from "../shared/schemas/negotiation-state.schema.js";
48
54
  export declare const NEGOTIATOR_STANCES: readonly ["advocate", "evaluator", "skeptic"];
@@ -84,9 +90,15 @@ export declare function stanceJobFraming(stance: NegotiatorStance): string;
84
90
  * own rules. Empty under `advocate` → byte-identical.
85
91
  *
86
92
  * `seat` scopes the responder verification rules to the seat that did NOT
87
- * open. Everything else here is seat-blind: the value bar and the consult
88
- * propensity are duties of both seats, and the seat parameter must not become
89
- * a reason to fork them.
93
+ * open. Everything else here is seat-blind: the value bar, the consult
94
+ * propensity and the evidence-provenance rule are duties of both seats, and
95
+ * the seat parameter must not become a reason to fork them.
96
+ *
97
+ * Order matters twice over. The seat-blind rules come first, so the initiator's
98
+ * rendering stays a strict PREFIX of the responder's — the invariant the stance
99
+ * spec checks by subtraction. And provenance lands immediately before the
100
+ * responder rules, so "ground the accept in what {userName} themselves stated"
101
+ * is already qualified by whose statements count when the responder reads it.
90
102
  */
91
103
  export declare function stanceActionRules(stance: NegotiatorStance, seat: NegotiationSeat): string;
92
104
  /**
@@ -9,11 +9,11 @@
9
9
  *
10
10
  * `NEGOTIATOR_STANCE` makes that stance configurable instead of hard-coded:
11
11
  *
12
- * | stance | framing | value bar | query rule | consult propensity | responder check | deadlock |
13
- * |-------------|--------------------------------------|------------------|-------------------------|-------------------------|--------------------------|-----------|
14
- * | `advocate` | argue the case (today) | none | mandate (today) | none (today) | none (today) | bargain |
15
- * | `evaluator` | assess first, advocate if it survives | opportunity-cost | necessary-not-sufficient| prefer over assumption | verify the opening | bargain |
16
- * | `skeptic` | + "most matches are not worth making" | opportunity-cost | necessary-not-sufficient| + unverified = don't proceed | + probe before accepting | stalemate |
12
+ * | stance | framing | value bar | query rule | consult propensity | evidence provenance | responder check | deadlock |
13
+ * |-------------|--------------------------------------|------------------|-------------------------|-------------------------|--------------------------|--------------------------|-----------|
14
+ * | `advocate` | argue the case (today) | none | mandate (today) | none (today) | none (today) | none (today) | bargain |
15
+ * | `evaluator` | assess first, advocate if it survives | opportunity-cost | necessary-not-sufficient| prefer over assumption | own record ≠ client's evidence | verify the opening | bargain |
16
+ * | `skeptic` | + "most matches are not worth making" | opportunity-cost | necessary-not-sufficient| + unverified = don't proceed | (same — no sharpening) | + probe before accepting | stalemate |
17
17
  *
18
18
  * Design constraints (hard):
19
19
  * - **`advocate` is byte-identical.** Every fragment below is additive and
@@ -43,6 +43,12 @@
43
43
  * renders them only there. They still name no action and no mechanism, so the
44
44
  * seat's own rules and the graph's grants stay the sole authority on what this
45
45
  * turn may actually do.
46
+ *
47
+ * The seat parameter is a scoping tool, not a licence to fork: a duty both
48
+ * seats hold stays in the shared prefix even when the failure that motivated it
49
+ * showed up on one seat. `EVIDENCE_PROVENANCE_RULE` is the case in point — it
50
+ * was written for a responder accept, and it renders seat-blind, because an
51
+ * initiator can cite its own prior openings' claims exactly as readily.
46
52
  */
47
53
  export const NEGOTIATOR_STANCES = ["advocate", "evaluator", "skeptic"];
48
54
  export const DEFAULT_NEGOTIATOR_STANCE = "advocate";
@@ -156,6 +162,49 @@ const CONSULT_PROPENSITY_RULE = `
156
162
  * reason not to proceed, and consulting the client is how it gets verified.
157
163
  */
158
164
  const SKEPTIC_CONSULT_SHARPENING = ` For you this is a gate, not a preference: an UNVERIFIED assumption that the two sides' intents actually align is a reason NOT to proceed, and consulting {userName} is how that assumption gets verified.`;
165
+ /**
166
+ * Evidence provenance — assessing stances, BOTH seats.
167
+ *
168
+ * The third sibling of the consult-propensity and responder-verification
169
+ * fragments, and written for the way the second one was formally obeyed and
170
+ * substantively evaded. A responder accepted a first contact grounded — as the
171
+ * responder rule demands — in its OWN side's record rather than in the
172
+ * opening's characterization. But the record it reached for was its own prior
173
+ * conclusions, surfaced through memory and prior dialogue: "{userName}'s
174
+ * previous acceptances ... reinforce this strong alignment", from acceptances
175
+ * this same negotiator had made under a weaker bar. Circular verification —
176
+ * I accepted before, therefore accepting is grounded.
177
+ *
178
+ * So the rule the verification duty was missing: an agent's own output is not
179
+ * its client's evidence. Verification grounds in what a PERSON authored — never
180
+ * in what an agent concluded about them, on either side of the table. The
181
+ * fragment names exactly the client-authored sections this prompt actually
182
+ * renders (intents, profile, and the client's own answers between sessions),
183
+ * so the ground it points at is one the negotiator can see.
184
+ *
185
+ * Two boundaries it deliberately does not cross:
186
+ * - **It does not ban memory.** Memory keeps the job it has (advisory notes on
187
+ * how to argue, what has been asked, what each side said); what changes is
188
+ * only what may count as verification. A fragment that told the negotiator to
189
+ * ignore its memory would fight `renderNegotiatorMemorySection` rather than
190
+ * complete it.
191
+ * - **It does not forbid resolving a repeat signal quickly.** The continuation
192
+ * policy in `negotiation.agent.ts` ("materially the same as one you
193
+ * previously evaluated ... you may resolve quickly") governs how much EFFORT
194
+ * a re-run deserves; this governs what counts as GROUNDS. The nearest
195
+ * existing neighbor is the IND-569 attribution policy — "do not treat their
196
+ * conclusions as decisions about this opportunity" — which scopes conclusions
197
+ * across opportunities; this scopes them across the decision/evidence line.
198
+ *
199
+ * No `skeptic` sharpening: the prior that most matches are not worth making
200
+ * does not change what an unverified assertion is worth. It is worth nothing
201
+ * under either assessing stance, and a sharpening here would only restate the
202
+ * rule louder.
203
+ *
204
+ * Names no action and no mechanism, like every other fragment in this module.
205
+ */
206
+ const EVIDENCE_PROVENANCE_RULE = `
207
+ - YOUR OWN RECORD IS DECISIONS, NOT EVIDENCE: your earlier turns, the connections you proposed or accepted on {userName}'s behalf, and the conclusions you carry in memory are YOUR record — decisions you made for them, reached under whatever bar you applied at the time. Leaning on one ("they have been open to this before", "the fit was already established") re-asserts a judgment instead of checking it, and reads your own past eagerness back as {userName}'s interest. Ground the fit in what a person stated for themselves: {userName}'s own intents, profile, and the answers they gave you directly on your side; the counterparty's own intents and profile on theirs. Prior dialogue and memory keep their job — what has already been asked, what each side actually said, how to pitch this one — but they are the history of the argument, not grounds for it. A fit that was not verified does not become verified by having been asserted before.`;
159
208
  /**
160
209
  * Responder verification — assessing stances, RESPONDING seat only.
161
210
  *
@@ -202,9 +251,15 @@ const SKEPTIC_RESPONDER_SHARPENING = ` For you an accept on the first exchange i
202
251
  * own rules. Empty under `advocate` → byte-identical.
203
252
  *
204
253
  * `seat` scopes the responder verification rules to the seat that did NOT
205
- * open. Everything else here is seat-blind: the value bar and the consult
206
- * propensity are duties of both seats, and the seat parameter must not become
207
- * a reason to fork them.
254
+ * open. Everything else here is seat-blind: the value bar, the consult
255
+ * propensity and the evidence-provenance rule are duties of both seats, and
256
+ * the seat parameter must not become a reason to fork them.
257
+ *
258
+ * Order matters twice over. The seat-blind rules come first, so the initiator's
259
+ * rendering stays a strict PREFIX of the responder's — the invariant the stance
260
+ * spec checks by subtraction. And provenance lands immediately before the
261
+ * responder rules, so "ground the accept in what {userName} themselves stated"
262
+ * is already qualified by whose statements count when the responder reads it.
208
263
  */
209
264
  export function stanceActionRules(stance, seat) {
210
265
  if (!stanceAppliesValueBar(stance))
@@ -215,7 +270,7 @@ export function stanceActionRules(stance, seat) {
215
270
  const responderRule = seat === "counterparty" && stanceVerifiesResponderFit(stance)
216
271
  ? RESPONDER_VERIFICATION_RULE + (stance === "skeptic" ? SKEPTIC_RESPONDER_SHARPENING : "")
217
272
  : "";
218
- return VALUE_BAR_RULE + consultRule + responderRule;
273
+ return VALUE_BAR_RULE + consultRule + EVIDENCE_PROVENANCE_RULE + responderRule;
219
274
  }
220
275
  /**
221
276
  * `skeptic` sharpening of the pre-contact consultation rule (the turn-0 third
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "22.0.0-rc.497.1",
3
+ "version": "22.0.0-rc.499.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",