@kontourai/survey 3.0.0 → 5.0.0

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.
Files changed (46) hide show
  1. package/README.md +4 -0
  2. package/dist/examples/calibrated-auto-accept.d.ts +22 -15
  3. package/dist/examples/calibrated-auto-accept.js +40 -36
  4. package/dist/examples/review-workbench/server-apply-consumer.js +5 -0
  5. package/dist/src/calibration.d.ts +48 -21
  6. package/dist/src/calibration.js +72 -33
  7. package/dist/src/canonical-reviewed-trust-input.js +73 -34
  8. package/dist/src/console/review-console-server.d.ts +3 -1
  9. package/dist/src/console/review-console-server.js +203 -50
  10. package/dist/src/extraction-envelope.d.ts +81 -3
  11. package/dist/src/extraction-envelope.js +183 -24
  12. package/dist/src/index.d.ts +9 -8
  13. package/dist/src/index.js +3 -3
  14. package/dist/src/inquiry-mapping.d.ts +15 -1
  15. package/dist/src/inquiry-mapping.js +10 -2
  16. package/dist/src/mcp/review-mcp.js +112 -90
  17. package/dist/src/producer-profile.d.ts +41 -2
  18. package/dist/src/producer-profile.js +29 -2
  19. package/dist/src/review-session-file.d.ts +64 -0
  20. package/dist/src/review-session-file.js +320 -0
  21. package/dist/src/review-workbench/edited-value.d.ts +70 -0
  22. package/dist/src/review-workbench/edited-value.js +147 -0
  23. package/dist/src/review-workbench/extraction-inspector.d.ts +15 -1
  24. package/dist/src/review-workbench/extraction-inspector.js +55 -19
  25. package/dist/src/review-workbench/queue-binding.js +1 -1
  26. package/dist/src/review-workbench/review-presentation.d.ts +46 -1
  27. package/dist/src/review-workbench/review-presentation.js +72 -1
  28. package/dist/src/review-workbench/review-queue-session.d.ts +19 -5
  29. package/dist/src/review-workbench/review-queue-session.js +54 -14
  30. package/dist/src/review-workbench/review-session-replay.d.ts +35 -1
  31. package/dist/src/review-workbench/review-session-replay.js +82 -3
  32. package/dist/src/review-workbench/review-workbench-css.generated.js +2 -0
  33. package/dist/src/review-workbench/review-workbench.css +2 -0
  34. package/dist/src/review-workbench/review-workbench.d.ts +22 -11
  35. package/dist/src/review-workbench/review-workbench.js +91 -26
  36. package/dist/src/review-workbench/review-workbench.standalone.css +2 -0
  37. package/dist/src/review-workbench/server-review-session.d.ts +3 -1
  38. package/dist/src/review-workbench/server-review-session.js +1 -0
  39. package/dist/src/reviewed-candidate-resolution.js +13 -7
  40. package/dist/src/schema-mapping.d.ts +23 -0
  41. package/dist/src/schema-mapping.js +30 -20
  42. package/dist/src/surface-reviewed-extraction.js +4 -0
  43. package/dist/src/to-surface.d.ts +30 -6
  44. package/dist/src/to-surface.js +312 -18
  45. package/dist/src/types.d.ts +44 -1
  46. package/package.json +5 -4
@@ -28,7 +28,11 @@ export interface Extraction {
28
28
  extractedAt: string;
29
29
  metadata?: Record<string, unknown>;
30
30
  }
31
- export type CandidateSetStatus = "resolved" | "needs-review" | "conflict" | "escalated";
31
+ /**
32
+ * `rejected`: a review rejected every candidate in the set and selected none
33
+ * (for example rejecting all conflicting values for one claim).
34
+ */
35
+ export type CandidateSetStatus = "resolved" | "needs-review" | "conflict" | "escalated" | "rejected";
32
36
  export type EscalationDimension = "framing" | "completeness" | "conclusion" | "citation";
33
37
  export interface Candidate {
34
38
  id: string;
@@ -104,11 +108,50 @@ export interface EscalationRecord {
104
108
  resolvedBy?: string;
105
109
  metadata?: Record<string, unknown>;
106
110
  }
111
+ /**
112
+ * The reading dimension of an {@link Interpretation} (#259, generalizing #16):
113
+ *
114
+ * - `"policy-standard"` — the original reading of how a policy-standard
115
+ * paragraph applies to the claim. This kind keeps the hard requirement that
116
+ * the anchor raw source is `kind: "policy-standard"`.
117
+ * - `"gleaned"` — what this result taught: an authored reading of what the
118
+ * anchored source material showed for the claim.
119
+ * - `"answerImpact"` — how the reading moved the inquiry answer the claim
120
+ * feeds (see {@link InterpretationAnswerImpact}); requires `answerImpact`.
121
+ *
122
+ * Additive-optional: a record with no `readingKind` is a `"policy-standard"`
123
+ * reading, so existing batches keep their exact prior validation and
124
+ * projection behavior. Interpretations never enter canonical review-proof
125
+ * bytes regardless of kind.
126
+ */
127
+ export type InterpretationReadingKind = "policy-standard" | "gleaned" | "answerImpact";
128
+ /**
129
+ * How an `"answerImpact"` reading moved the inquiry answer its claim feeds:
130
+ * the result `supported` the answer, `narrowed` it, or was recorded as an
131
+ * `accepted-risk`. "Answer" means the inquiry answer (inquiry-mapping);
132
+ * downstream decisions stay with consumers.
133
+ */
134
+ export type InterpretationAnswerImpact = "supported" | "narrowed" | "accepted-risk";
107
135
  export interface Interpretation {
108
136
  id: string;
109
137
  appliesToTarget?: string;
110
138
  appliesToClaimId?: string;
139
+ /**
140
+ * Which reading dimension this record carries. Absent means
141
+ * `"policy-standard"` (the pre-#259 behavior, unchanged).
142
+ */
143
+ readingKind?: InterpretationReadingKind;
144
+ /**
145
+ * Required when `readingKind` is `"answerImpact"`; illegal for any other
146
+ * kind. The structured impact beside the free-text `reading`.
147
+ */
148
+ answerImpact?: InterpretationAnswerImpact;
111
149
  anchorsToSourceId: string;
150
+ /**
151
+ * Locator inside the anchor source: the rule paragraph for a
152
+ * `"policy-standard"` reading, or the result location the producer read for
153
+ * `"gleaned"` / `"answerImpact"` readings.
154
+ */
112
155
  ruleLocator: string;
113
156
  reading: string;
114
157
  actor: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontourai/survey",
3
- "version": "3.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Producer-side source, extraction, candidate, and review contracts for projecting verified claims into Surface.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -72,9 +72,9 @@
72
72
  "workflow:validate-artifacts": "flow-agents-validate-artifacts"
73
73
  },
74
74
  "dependencies": {
75
- "@kontourai/surface": "^2.13.0",
75
+ "@kontourai/surface": "^2.13.0 || ^3.0.0 || ^4.0.0",
76
76
  "@modelcontextprotocol/server": "2.0.0",
77
- "zod": "4.2.0"
77
+ "zod": "4.4.3"
78
78
  },
79
79
  "peerDependencies": {
80
80
  "typescript": ">=5.0.0"
@@ -85,7 +85,7 @@
85
85
  }
86
86
  },
87
87
  "devDependencies": {
88
- "@kontourai/flow-agents": "5.5.0",
88
+ "@kontourai/flow-agents": "5.10.0",
89
89
  "@kontourai/traverse": "^0.25.0",
90
90
  "@kontourai/ui": "^1.1.0",
91
91
  "@playwright/test": "^1.62.0",
@@ -96,6 +96,7 @@
96
96
  "engines": {
97
97
  "node": ">=22"
98
98
  },
99
+ "packageManager": "pnpm@11.25.0",
99
100
  "bin": {
100
101
  "survey-review-mcp": "./bin/survey-review-mcp.mjs",
101
102
  "survey-review-console": "./bin/survey-review-console.mjs"