instar 1.3.730 → 1.3.731

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 (63) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +80 -1
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/core/CoherenceGate.d.ts +119 -0
  5. package/dist/core/CoherenceGate.d.ts.map +1 -1
  6. package/dist/core/CoherenceGate.js +342 -19
  7. package/dist/core/CoherenceGate.js.map +1 -1
  8. package/dist/core/CoherenceReviewer.d.ts +30 -0
  9. package/dist/core/CoherenceReviewer.d.ts.map +1 -1
  10. package/dist/core/CoherenceReviewer.js +14 -0
  11. package/dist/core/CoherenceReviewer.js.map +1 -1
  12. package/dist/core/FileClassifier.d.ts.map +1 -1
  13. package/dist/core/FileClassifier.js +7 -0
  14. package/dist/core/FileClassifier.js.map +1 -1
  15. package/dist/core/PostUpdateMigrator.d.ts +1 -0
  16. package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
  17. package/dist/core/PostUpdateMigrator.js +25 -0
  18. package/dist/core/PostUpdateMigrator.js.map +1 -1
  19. package/dist/core/ResponseReviewDecisionLog.d.ts +45 -0
  20. package/dist/core/ResponseReviewDecisionLog.d.ts.map +1 -0
  21. package/dist/core/ResponseReviewDecisionLog.js +85 -0
  22. package/dist/core/ResponseReviewDecisionLog.js.map +1 -0
  23. package/dist/core/WriteDomainRegistry.d.ts.map +1 -1
  24. package/dist/core/WriteDomainRegistry.js +21 -0
  25. package/dist/core/WriteDomainRegistry.js.map +1 -1
  26. package/dist/core/conversationContextWiring.d.ts +51 -0
  27. package/dist/core/conversationContextWiring.d.ts.map +1 -0
  28. package/dist/core/conversationContextWiring.js +78 -0
  29. package/dist/core/conversationContextWiring.js.map +1 -0
  30. package/dist/core/reviewers/conversational-tone.d.ts.map +1 -1
  31. package/dist/core/reviewers/conversational-tone.js +15 -1
  32. package/dist/core/reviewers/conversational-tone.js.map +1 -1
  33. package/dist/core/types.d.ts +39 -0
  34. package/dist/core/types.d.ts.map +1 -1
  35. package/dist/core/types.js.map +1 -1
  36. package/dist/core/untrustedConversationContext.d.ts +77 -0
  37. package/dist/core/untrustedConversationContext.d.ts.map +1 -0
  38. package/dist/core/untrustedConversationContext.js +134 -0
  39. package/dist/core/untrustedConversationContext.js.map +1 -0
  40. package/dist/monitoring/ReviewCanaryBattery.d.ts +160 -0
  41. package/dist/monitoring/ReviewCanaryBattery.d.ts.map +1 -0
  42. package/dist/monitoring/ReviewCanaryBattery.js +416 -0
  43. package/dist/monitoring/ReviewCanaryBattery.js.map +1 -0
  44. package/dist/scaffold/templates.d.ts.map +1 -1
  45. package/dist/scaffold/templates.js +5 -0
  46. package/dist/scaffold/templates.js.map +1 -1
  47. package/dist/server/AgentServer.d.ts +4 -0
  48. package/dist/server/AgentServer.d.ts.map +1 -1
  49. package/dist/server/AgentServer.js +1 -0
  50. package/dist/server/AgentServer.js.map +1 -1
  51. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  52. package/dist/server/CapabilityIndex.js +1 -0
  53. package/dist/server/CapabilityIndex.js.map +1 -1
  54. package/dist/server/routes.d.ts +5 -0
  55. package/dist/server/routes.d.ts.map +1 -1
  56. package/dist/server/routes.js +36 -1
  57. package/dist/server/routes.js.map +1 -1
  58. package/package.json +1 -1
  59. package/src/data/builtin-manifest.json +64 -64
  60. package/src/scaffold/templates/jobs/instar/review-canary-battery.md +31 -0
  61. package/src/scaffold/templates.ts +5 -0
  62. package/upgrades/1.3.731.md +97 -0
  63. package/upgrades/side-effects/context-aware-outbound-review.md +62 -0
@@ -0,0 +1,45 @@
1
+ /**
2
+ * ResponseReviewDecisionLog — the durable would-block decision log
3
+ * (context-aware-outbound-review spec §D8, the flip-evidence store).
4
+ *
5
+ * The in-memory `CoherenceGate.reviewHistory` is pruned to 1000 entries and
6
+ * erased by every server restart — a data-gated enforcement-flip criterion
7
+ * ("a clean day on real traffic") cannot rest on a store any restart wipes.
8
+ * This append-only JSONL (`logs/response-review-decisions.jsonl`) is the
9
+ * restart-surviving record: one line per `_evaluate` verdict (ALL outcomes,
10
+ * not just would-blocks — the §D9.3 denominator matters), written at the same
11
+ * seam as `logAudit`, plus the two additive soak row types (counterfactual
12
+ * rows, §D9.4; canary/battery rows, §D9.4b — written through this SAME
13
+ * writer so there is exactly one file and one rotation policy).
14
+ *
15
+ * At-rest honesty (§D8): rows persist 200 credential-scrubbed chars of every
16
+ * reviewed turn plus topicId, as a plaintext machine-local file under
17
+ * filesystem permissions — the same posture as sibling JSONLs, NOT the
18
+ * encrypted vault. That is the trade for restart-surviving flip evidence.
19
+ *
20
+ * Failure direction: write failures are swallowed — telemetry must never
21
+ * affect a verdict or delivery (§D5: the D8 write is one of the individually
22
+ * contained context code paths; the HTTP seam above fails OPEN so nothing
23
+ * here may throw into `_evaluate`).
24
+ */
25
+ export declare class ResponseReviewDecisionLog {
26
+ private readonly logPath;
27
+ private readonly maxBytes;
28
+ constructor(logPath: string, options?: {
29
+ maxBytes?: number;
30
+ });
31
+ /** The absolute path of the JSONL file (for tests + observability). */
32
+ getPath(): string;
33
+ /**
34
+ * Append one row. Swallows every failure — the decision log is telemetry;
35
+ * a full disk or unwritable path must never affect a review verdict.
36
+ */
37
+ append(row: Record<string, unknown>): void;
38
+ /**
39
+ * Size rotation: when the file exceeds maxBytes, rename it to `<path>.1`
40
+ * (replacing the previous archive) and start fresh — the same bounded
41
+ * single-archive policy sibling JSONLs use. Contained; never throws.
42
+ */
43
+ private rotateIfNeeded;
44
+ }
45
+ //# sourceMappingURL=ResponseReviewDecisionLog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseReviewDecisionLog.d.ts","sourceRoot":"","sources":["../../src/core/ResponseReviewDecisionLog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAQH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;gBAEtB,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE;IAK5D,uEAAuE;IACvE,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAW1C;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAqBvB"}
@@ -0,0 +1,85 @@
1
+ /**
2
+ * ResponseReviewDecisionLog — the durable would-block decision log
3
+ * (context-aware-outbound-review spec §D8, the flip-evidence store).
4
+ *
5
+ * The in-memory `CoherenceGate.reviewHistory` is pruned to 1000 entries and
6
+ * erased by every server restart — a data-gated enforcement-flip criterion
7
+ * ("a clean day on real traffic") cannot rest on a store any restart wipes.
8
+ * This append-only JSONL (`logs/response-review-decisions.jsonl`) is the
9
+ * restart-surviving record: one line per `_evaluate` verdict (ALL outcomes,
10
+ * not just would-blocks — the §D9.3 denominator matters), written at the same
11
+ * seam as `logAudit`, plus the two additive soak row types (counterfactual
12
+ * rows, §D9.4; canary/battery rows, §D9.4b — written through this SAME
13
+ * writer so there is exactly one file and one rotation policy).
14
+ *
15
+ * At-rest honesty (§D8): rows persist 200 credential-scrubbed chars of every
16
+ * reviewed turn plus topicId, as a plaintext machine-local file under
17
+ * filesystem permissions — the same posture as sibling JSONLs, NOT the
18
+ * encrypted vault. That is the trade for restart-surviving flip evidence.
19
+ *
20
+ * Failure direction: write failures are swallowed — telemetry must never
21
+ * affect a verdict or delivery (§D5: the D8 write is one of the individually
22
+ * contained context code paths; the HTTP seam above fails OPEN so nothing
23
+ * here may throw into `_evaluate`).
24
+ */
25
+ import fs from 'node:fs';
26
+ import path from 'node:path';
27
+ import { SafeFsExecutor } from './SafeFsExecutor.js';
28
+ const DEFAULT_MAX_BYTES = 10 * 1024 * 1024; // 10MB, size-rotated like sibling JSONLs
29
+ export class ResponseReviewDecisionLog {
30
+ logPath;
31
+ maxBytes;
32
+ constructor(logPath, options) {
33
+ this.logPath = logPath;
34
+ this.maxBytes = options?.maxBytes ?? DEFAULT_MAX_BYTES;
35
+ }
36
+ /** The absolute path of the JSONL file (for tests + observability). */
37
+ getPath() {
38
+ return this.logPath;
39
+ }
40
+ /**
41
+ * Append one row. Swallows every failure — the decision log is telemetry;
42
+ * a full disk or unwritable path must never affect a review verdict.
43
+ */
44
+ append(row) {
45
+ try {
46
+ fs.mkdirSync(path.dirname(this.logPath), { recursive: true });
47
+ this.rotateIfNeeded();
48
+ fs.appendFileSync(this.logPath, JSON.stringify(row) + '\n', 'utf8');
49
+ }
50
+ catch {
51
+ // @silent-fallback-ok — §D8: decision-log write failures are swallowed;
52
+ // the verdict and delivery are unaffected (telemetry never gates).
53
+ }
54
+ }
55
+ /**
56
+ * Size rotation: when the file exceeds maxBytes, rename it to `<path>.1`
57
+ * (replacing the previous archive) and start fresh — the same bounded
58
+ * single-archive policy sibling JSONLs use. Contained; never throws.
59
+ */
60
+ rotateIfNeeded() {
61
+ try {
62
+ const stat = fs.statSync(this.logPath);
63
+ if (stat.size < this.maxBytes)
64
+ return;
65
+ const archive = `${this.logPath}.1`;
66
+ try {
67
+ SafeFsExecutor.safeRmSync(archive, {
68
+ force: true,
69
+ operation: 'ResponseReviewDecisionLog.rotate (drop the previous single archive)',
70
+ });
71
+ }
72
+ catch {
73
+ // @silent-fallback-ok — a stale archive that cannot be removed only
74
+ // means renameSync below may fail; that failure is caught too.
75
+ }
76
+ fs.renameSync(this.logPath, archive);
77
+ }
78
+ catch {
79
+ // @silent-fallback-ok — a missing file (ENOENT on first write) or a
80
+ // failed rotation both degrade to "keep appending"; telemetry never
81
+ // gates and the append itself is separately contained.
82
+ }
83
+ }
84
+ }
85
+ //# sourceMappingURL=ResponseReviewDecisionLog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResponseReviewDecisionLog.js","sourceRoot":"","sources":["../../src/core/Respon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CAAC,EAAE,CAA8B;IACjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAoB;IAC3C,+EAA+E;IAC/E,QAAQ,CAAC,sBAAsB,EAAE,qBAAqB,EAAE,CAAM;IAE9D;;2DAEuD;IACvD,GAAG,CAAC,KAAK,EAAE,gBAAgB,GAAG,IAAI;IAsBlC;;;;OAIG;IACH,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,IAAI;IAO9D,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,WAAW,CAAC;QAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAAA;KAAE;IAK/F;8BAC0B;IAC1B,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI;IAQnE,qEAAqE;IACrE,YAAY,IAAI,SAAS,UAAU,EAAE;IAIrC,MAAM,IAAI,MAAM,EAAE;IAIlB,OAAO,IAAI,MAAM,EAAE;CAGpB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAAG,mBAAmB,CA0EhG"}
@@ -181,6 +181,27 @@ export function buildWriteDomainRegistry(opts) {
181
181
  reg.add({ kind: 'route', method: 'PATCH', pathPrefix: '/evolution/', domain: 'machine-local', story: evolutionStory });
182
182
  reg.add({ kind: 'route', method: 'POST', pathPrefix: '/attention', domain: 'machine-local', story: attentionStory });
183
183
  reg.add({ kind: 'route', method: 'PATCH', pathPrefix: '/attention', domain: 'machine-local', story: attentionStory });
184
+ // ── Review canary battery trigger (context-aware-outbound-review §D9.4b) ──
185
+ // Machine-local by construction: the Bearer-gated soak trigger runs THIS
186
+ // machine's review pipeline against booby-trapped fixtures. Its only writes
187
+ // are (a) transient fixture rows in the per-machine topic-memory SQLite,
188
+ // scoped to reserved NEGATIVE topic ids and removed in a finally (plus the
189
+ // next run's pre-clean, R4-m4), and (b) append-only batterySummary /
190
+ // decision rows in logs/response-review-decisions.jsonl — per-machine soak
191
+ // EVIDENCE, never authority, never converged across machines. Re-running
192
+ // the battery regenerates everything the route ever writes.
193
+ reg.add({
194
+ kind: 'route',
195
+ method: 'POST',
196
+ pathPrefix: '/review/canary-battery/run',
197
+ domain: 'machine-local',
198
+ story: {
199
+ logical: 'ephemeral-rebuildable',
200
+ onSharedGitSyncedPath: true,
201
+ fileLevel: 'git-sync-excluded',
202
+ note: 'canary fixtures are finally-cleaned rows in the per-machine topic-memory SQLite (reserved negative topic ids); the D8 decision log is per-machine soak evidence; file-level arm shipped in FileClassifier sync exclusions (.instar/topic-memory.db + logs/response-review-decisions.jsonl)',
203
+ },
204
+ });
184
205
  return reg;
185
206
  }
186
207
  //# sourceMappingURL=WriteDomainRegistry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WriteDomainRegistry.js","sourceRoot":"","sources":["../../src/core/WriteDomainRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAkEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,KAAK,CAAC;AAEtD,SAAS,UAAU,CAAC,KAAmC;IACrD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,+CAA+C,EAAE,CAAC;IAC1F,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QACpD,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,8HAA8H;SACvI,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC;AACtB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,OAAO,SAAS,CAAC,O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ation for the
3
+ * context-aware outbound review feature (spec §D1/§D4, Know Your Principal).
4
+ *
5
+ * The CoherenceGate stays decoupled from src/users/ and src/memory/: it sees
6
+ * only the injected `conversationContextProvider` function. THIS module is
7
+ * what the server wires that provider to — it converts raw TopicMemory rows
8
+ * plus the topic's verified-operator binding into the provider's return shape:
9
+ * role-labeled rows with per-row `verifiedOperator` tags AND the window's
10
+ * structural `askLicenseMode` (R4-m1: the provider RETURNS the wiring-computed
11
+ * values — the gate copies the mode into `conversationContextMeta` and NEVER
12
+ * computes or infers it).
13
+ *
14
+ * Principal rules (§D4, all computed from AUTHENTICATED uids — never content):
15
+ * - Role comes from the store's `fromUser` column, never message text.
16
+ * - BOUND topic (TopicOperatorStore binding present): mode =
17
+ * 'verified-operator'; each user row whose authenticated `telegramUserId`
18
+ * matches the binding uid is tagged `verifiedOperator: true` (rendered
19
+ * `USER(verified-operator):`); non-matching and uid-less rows render plain
20
+ * `USER:` (weak corroboration by the prompt contract).
21
+ * - UNBOUND topic: 'single-sender' ONLY when EVERY user-role row in the
22
+ * window carries an authenticated uid AND exactly ONE distinct uid appears
23
+ * (R4-L1: "at most one" would misread a zero-uid window as licensed).
24
+ * A window containing ANY uid-less user-role row — or 2+ distinct uids, or
25
+ * zero user rows — computes 'weak-corroboration-only' (R3-M2: an
26
+ * unverifiable sender can never help LICENSE; fail-closed).
27
+ *
28
+ * A throw anywhere in here is a PROVIDER throw, caught at acquisition inside
29
+ * CoherenceGate._evaluate per §D5 (degrades to no context section).
30
+ */
31
+ import type { AskLicenseMode, ConversationContextMessage } from './untrustedConversationContext.js';
32
+ /** The subset of a TopicMemory row this computation reads. */
33
+ export interface ConversationSourceRow {
34
+ text: string;
35
+ fromUser: boolean;
36
+ /** Telegram numeric user ID — the authoritative authenticated identity. */
37
+ telegramUserId?: number | null;
38
+ }
39
+ /** The provider return shape (CoherenceGateOptions.conversationContextProvider). */
40
+ export interface ConversationContextProviderResult {
41
+ messages: ConversationContextMessage[];
42
+ askLicenseMode: AskLicenseMode;
43
+ }
44
+ /**
45
+ * Compute the provider result from raw rows + the topic's verified-operator
46
+ * binding (null when the topic is unbound). Pure and synchronous.
47
+ */
48
+ export declare function buildConversationContext(rows: ConversationSourceRow[], operator: {
49
+ uid: string;
50
+ } | null): ConversationContextProviderResult;
51
+ //# sourceMappingURL=conversationContextWiring.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversationContextWiring.d.ts","sourceRoot":"","sources":["../../src/core/conversationContextWiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,0BAA0B,EAC3B,MAAM,mCAAmC,CAAC;AAE3C,8DAA8D;AAC9D,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAED,oFAAoF;AACpF,MAAM,WAAW,iCAAiC;IAChD,QAAQ,EAAE,0BAA0B,EAAE,CAAC;IACvC,cAAc,EAAE,cAAc,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,qBAAqB,EAAE,EAC7B,QAAQ,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GAC/B,iCAAiC,CA6CnC"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * conversationContextWiring — the WIRING-layer principal computation for the
3
+ * context-aware outbound review feature (spec §D1/§D4, Know Your Principal).
4
+ *
5
+ * The CoherenceGate stays decoupled from src/users/ and src/memory/: it sees
6
+ * only the injected `conversationContextProvider` function. THIS module is
7
+ * what the server wires that provider to — it converts raw TopicMemory rows
8
+ * plus the topic's verified-operator binding into the provider's return shape:
9
+ * role-labeled rows with per-row `verifiedOperator` tags AND the window's
10
+ * structural `askLicenseMode` (R4-m1: the provider RETURNS the wiring-computed
11
+ * values — the gate copies the mode into `conversationContextMeta` and NEVER
12
+ * computes or infers it).
13
+ *
14
+ * Principal rules (§D4, all computed from AUTHENTICATED uids — never content):
15
+ * - Role comes from the store's `fromUser` column, never message text.
16
+ * - BOUND topic (TopicOperatorStore binding present): mode =
17
+ * 'verified-operator'; each user row whose authenticated `telegramUserId`
18
+ * matches the binding uid is tagged `verifiedOperator: true` (rendered
19
+ * `USER(verified-operator):`); non-matching and uid-less rows render plain
20
+ * `USER:` (weak corroboration by the prompt contract).
21
+ * - UNBOUND topic: 'single-sender' ONLY when EVERY user-role row in the
22
+ * window carries an authenticated uid AND exactly ONE distinct uid appears
23
+ * (R4-L1: "at most one" would misread a zero-uid window as licensed).
24
+ * A window containing ANY uid-less user-role row — or 2+ distinct uids, or
25
+ * zero user rows — computes 'weak-corroboration-only' (R3-M2: an
26
+ * unverifiable sender can never help LICENSE; fail-closed).
27
+ *
28
+ * A throw anywhere in here is a PROVIDER throw, caught at acquisition inside
29
+ * CoherenceGate._evaluate per §D5 (degrades to no context section).
30
+ */
31
+ /**
32
+ * Compute the provider result from raw rows + the topic's verified-operator
33
+ * binding (null when the topic is unbound). Pure and synchronous.
34
+ */
35
+ export function buildConversationContext(rows, operator) {
36
+ const boundUid = operator && typeof operator.uid === 'string' && operator.uid.length > 0
37
+ ? operator.uid
38
+ : null;
39
+ const messages = rows.map((r) => {
40
+ const role = r.fromUser ? 'user' : 'agent';
41
+ const msg = {
42
+ role,
43
+ text: typeof r.text === 'string' ? r.text : String(r.text ?? ''),
44
+ };
45
+ if (boundUid !== null &&
46
+ role === 'user' &&
47
+ r.telegramUserId !== null &&
48
+ r.telegramUserId !== undefined &&
49
+ String(r.telegramUserId) === boundUid) {
50
+ msg.verifiedOperator = true;
51
+ }
52
+ return msg;
53
+ });
54
+ let askLicenseMode;
55
+ if (boundUid !== null) {
56
+ // Bound topic: the binding IS the license authority. Uid-less rows are
57
+ // already rendered plain USER: (weak corroboration) by the tag rule above.
58
+ askLicenseMode = 'verified-operator';
59
+ }
60
+ else {
61
+ const userRows = rows.filter((r) => r.fromUser);
62
+ const uids = new Set();
63
+ let anyUidless = userRows.length === 0; // zero user rows can never license
64
+ for (const r of userRows) {
65
+ if (r.telegramUserId === null || r.telegramUserId === undefined) {
66
+ anyUidless = true;
67
+ }
68
+ else {
69
+ uids.add(String(r.telegramUserId));
70
+ }
71
+ }
72
+ askLicenseMode = !anyUidless && uids.size === 1
73
+ ? 'single-sender'
74
+ : 'weak-corroboration-only';
75
+ }
76
+ return { messages, askLicenseMode };
77
+ }
78
+ //# sourceMappingURL=conversationContextWiring.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversationContextWiring.js","sourceRoot":"","sources":["../../src/core/conversationContextWiring.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAqBH;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAA6B,EAC7B,QAAgC;IAEhC,MAAM,QAAQ,GAAG,QAAQ,IAAI,OAAO,QAAQ,CAAC,GAAG,KAAK,QAAQ,IAAI,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;QACtF,CAAC,CAAC,QAAQ,CAAC,GAAG;QACd,CAAC,CAAC,IAAI,CAAC;IAET,MAAM,QAAQ,GAAiC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;QAC5D,MAAM,IAAI,GAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;QAC7D,MAAM,GAAG,GAA+B;YACtC,IAAI;YACJ,IAAI,EAAE,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;SACjE,CAAC;QACF,IACE,QAAQ,KAAK,IAAI;YACjB,IAAI,KAAK,MAAM;YACf,CA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GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9E,qBAAa,0BAA2B,SAAQ,iBAAiB;gBACnD,OAAO,CAAC,EAAE,eAAe;IAIrC,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM;CA4CtD"}
1
+ {"version":3,"file":"conversational-tone.d.ts","sourceRoot":"","sources":["../../../src/core/reviewers/conversational-tone.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG9E,qBAAa,0BAA2B,SAAQ,iBAAiB;gBACnD,OAAO,CAAC,EAAE,eAAe;IAIrC,SAAS,CAAC,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,MAAM;CA+DtD"}
@@ -5,6 +5,7 @@
5
5
  * technical implementation details that should not be exposed to users.
6
6
  */
7
7
  import { CoherenceReviewer } from '../CoherenceReviewer.js';
8
+ import { renderUntrustedConversation } from '../untrustedConversationContext.js';
8
9
  export class ConversationalToneReviewer extends CoherenceReviewer {
9
10
  constructor(options) {
10
11
  super('conversational-tone', options);
@@ -22,6 +23,19 @@ export class ConversationalToneReviewer extends CoherenceReviewer {
22
23
  relationshipHint += `\nRelationship formality: ${rc.formality}`;
23
24
  }
24
25
  }
26
+ // Context-aware carve-out (context-aware-outbound-review §D3): render the
27
+ // ONE ATOMIC block (context section + prompt contract) ONLY when the gate
28
+ // handed this reviewer the augmented ctx (opt-in set + primary-user
29
+ // recipient — structural scoping). Absent fields ⇒ conversationSection is
30
+ // '' and the prompt is BYTE-IDENTICAL to feature-dark: the pre-existing
31
+ // static "Code the user explicitly asked to see" exception stands exactly
32
+ // as today. The renderer never throws (total containment, §D5).
33
+ let conversationSection = '';
34
+ if (context.recentConversation &&
35
+ context.recentConversation.length > 0 &&
36
+ context.conversationContextMeta) {
37
+ conversationSection = renderUntrustedConversation(context.recentConversation, context.conversationContextMeta);
38
+ }
25
39
  return `${preamble}
26
40
 
27
41
  You are a communication quality reviewer. Your job: ensure agent messages to users contain NO technical implementation details.
@@ -42,7 +56,7 @@ EXCEPTIONS (these ARE allowed):
42
56
  - Code the user explicitly asked to see
43
57
 
44
58
  This message will be sent via ${context.channel}. Consider channel-appropriateness.
45
- ${relationshipHint}
59
+ ${relationshipHint}${conversationSection}
46
60
 
47
61
  Respond EXCLUSIVELY with valid JSON:
48
62
  { "pass": boolean, "severity": "block"|"warn", "issue": "...", "suggestion": "..." }
@@ -1 +1 @@
1
- {"version":3,"file":"conversational-tone.js","sourceRoot":"","sources":["../../../src/core/reviewers/conversational-tone.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG5D,MAAM,OAAO,0BAA2B,SAAQ,iBAAiB;IAC/D,YAAY,OAAyB;QACnC,KAAK,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAES,WAAW,CAAC,OAAsB;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,0BAA0B,EAAE,CAAC;QAEnD,IAAI,gBAAgB,GAAG,EAAE,CAAC;QAC1B,IAAI,OAAO,CAAC,mBAAmB,EAAE,CAAC;YAChC,MAAM,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;YACvC,IAAI,EAAE,CAAC,kBAAkB,EAAE,CAAC;gBAC1B,gBAAgB,IAAI,uCAAuC,EAAE,CAAC,kBAAkB,EAAE,CAAC;YACrF,CAAC;YACD,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;gBACjB,gBAAgB,IAAI,6BAA6B,EAAE,CAAC,SAAS,EAAE,CA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,OAAO,CAAC,kBAAkB;YAC1B,OAAO,CAAC,kBAAkB,CAAC,MAAM,GAAG,CAAC;YACrC,OAAO,CAAC,uBAAuB,EAC/B,CAAC;YACD,mBAAmB,GAAG,2BAA2B,CAC/C,OAAO,CAAC,kBAAkB,EAC1B,OAAO,CAAC,uBAAuB,CAChC,CAAC;QACJ,CAAC;QAED,OAAO,GAAG,QAAQ;;;;;;;;;;;;;;;;;;;gCAmBU,OAAO,CAAC,OAAO;EAC7C,gBAAgB,GAAG,mBAAmB;;;;;;;EAOtC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,CAAC;IAC9C,CAAC;CACF"}
@@ -4185,6 +4185,45 @@ export interface ResponseReviewConfig {
4185
4185
  promptCaching?: boolean;
4186
4186
  /** Disable the test endpoint */
4187
4187
  testEndpointDisabled?: boolean;
4188
+ /**
4189
+ * Context-aware reviewers (context-aware-outbound-review spec §D10): feed a
4190
+ * bounded, untrusted-data-enveloped slice of recent conversation to the
4191
+ * OPTED-IN reviewers so the "user explicitly asked for this" carve-out has
4192
+ * an input to judge. `enabled` is deliberately OMITTED from config defaults
4193
+ * so the developmentAgent dark gate resolves it (LIVE on a dev agent, DARK
4194
+ * on the fleet; explicit false force-darks, explicit true is the fleet
4195
+ * flip). Resolution happens at the WIRING layer (server.ts liveConfig
4196
+ * getter) — the gate receives a pre-resolved block and reads it LIVE per
4197
+ * evaluate (kill-switch without restart).
4198
+ */
4199
+ conversationalContext?: ConversationalContextConfig;
4200
+ }
4201
+ /**
4202
+ * Config block for the context-aware reviewer feature
4203
+ * (`responseReview.conversationalContext`). All tunables have in-code
4204
+ * defaults; no migrateConfig entry exists on purpose (the dev-gate convention
4205
+ * REQUIRES `enabled` to be absent — a migration writing `enabled: false`
4206
+ * would recreate the PR #1001 bug the devAgentGate funnel exists to prevent).
4207
+ */
4208
+ export interface ConversationalContextConfig {
4209
+ /** OMITTED by default ⇒ resolveDevAgentGate decides (dev LIVE / fleet DARK). */
4210
+ enabled?: boolean;
4211
+ /** Max conversation messages rendered per review (default 6). */
4212
+ maxMessages?: number;
4213
+ /** Per-message char clamp (default 500). */
4214
+ maxCharsPerMessage?: number;
4215
+ /** Total char hard clamp, oldest dropped first (default 4000). */
4216
+ maxTotalChars?: number;
4217
+ /**
4218
+ * Built-in reviewers that receive the context section (default
4219
+ * ['conversational-tone'] — spec §D3, round-1 M1: `information-leakage` is
4220
+ * EXCLUDED by design; widening requires its own principal analysis and a
4221
+ * spec revision, never a config-only addition). Named `injectReviewers`
4222
+ * (not `reviewers`) because the sibling `responseReview.reviewers` key is
4223
+ * an object map — a same-named array one nesting level down invites
4224
+ * mis-merge (spec r2, round-1 m3).
4225
+ */
4226
+ injectReviewers?: string[];
4188
4227
  }
4189
4228
  export interface ReviewerConfig {
4190
4229
  enabled: boolean;