snipara-companion 3.5.6 → 3.5.8

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
@@ -2,6 +2,27 @@
2
2
 
3
3
  Release notes for `snipara-companion`, newest first.
4
4
 
5
+ ## New In 3.5.8
6
+
7
+ - Preserves the exact collaboration actor identity on hosted lease heartbeat
8
+ and release requests, preventing owner-authenticated cleanup from falling
9
+ back to the API-key actor and returning a false `403`.
10
+
11
+ ## New In 3.5.7
12
+
13
+ - Bounds the best-effort hosted judgment lookup in `run` to 8 seconds instead
14
+ of silently waiting for up to 30 seconds.
15
+ - Exposes `hostedJudgment.status` as `linked`, `unlinked`, or `unavailable` in
16
+ JSON and prints one concise human-readable diagnostic without blocking the
17
+ local Judgment Card.
18
+ - Compatibility note: hosted context queries now treat an explicit
19
+ `max_tokens` value as immutable. Small conceptual or multi-hop budgets may
20
+ return less context than older servers that silently enlarged the request;
21
+ increase the requested budget when more context is intentional.
22
+ - Clarifies that references mode budgets the Answer Pack plus previews. Full
23
+ referenced chunks remain retrievable and their `token_count` is planning
24
+ metadata rather than initial response usage.
25
+
5
26
  ## New In 3.5.6
6
27
 
7
28
  - Adds a managed workflow Judgment V1 loop: `workflow judgment` serves and
package/dist/index.d.ts CHANGED
@@ -1471,7 +1471,7 @@ declare class RLMClient {
1471
1471
  resources?: CollaborationResource[];
1472
1472
  metadata?: Record<string, unknown>;
1473
1473
  }): Promise<CollaborationLeaseResponse>;
1474
- updateCollaborationLease(leaseId: string, args: {
1474
+ updateCollaborationLease(leaseId: string, args: CollaborationActorPayload & {
1475
1475
  action?: "heartbeat" | "release" | "override";
1476
1476
  reason?: string;
1477
1477
  }): Promise<CollaborationLeaseUpdateResponse>;
@@ -2773,12 +2773,20 @@ interface ProjectRunAdvisorReceiptCapture {
2773
2773
  measurement: ProjectRunAdvisorMeasurementCoverage;
2774
2774
  reason?: ProjectRunAdvisorReceiptSkipReason;
2775
2775
  }
2776
+ interface ProjectRunHostedJudgmentLink {
2777
+ version: "project-intelligence.hosted-judgment-link.v1";
2778
+ status: "linked" | "unlinked" | "unavailable";
2779
+ timeoutMs: number;
2780
+ servedJudgmentId?: string;
2781
+ error?: string;
2782
+ }
2776
2783
  interface ProjectIntelligenceRunResult {
2777
2784
  version: "project-intelligence.production-run.v1";
2778
2785
  generatedAt: string;
2779
2786
  runEnvelope: ProjectIntelligenceRunEnvelope;
2780
2787
  release: boolean;
2781
2788
  brief: ProjectIntelligenceBrief;
2789
+ hostedJudgment: ProjectRunHostedJudgmentLink;
2782
2790
  guard?: ProjectRunGuardResult;
2783
2791
  packageReview?: ProjectRunPackageReview;
2784
2792
  policyGates: ProjectPolicyGatesResult;
package/dist/index.js CHANGED
@@ -12285,6 +12285,79 @@ function uniqueStrings12(values) {
12285
12285
  return [...new Set(values.map((value) => value.trim()).filter(Boolean))];
12286
12286
  }
12287
12287
 
12288
+ // ../project-intelligence-contracts/src/why-capture-confidence-v1.json
12289
+ var why_capture_confidence_v1_default = {
12290
+ version: "why-capture-confidence-v1",
12291
+ base: 0.72,
12292
+ decisionRationaleBonus: 0.1,
12293
+ nonManualSourceBonus: 0.04,
12294
+ maximum: 0.9,
12295
+ decimalPlaces: 2,
12296
+ validatedExecutionOutcomes: ["completed"],
12297
+ vectors: [
12298
+ {
12299
+ candidateType: "CONTEXT",
12300
+ hasDecision: false,
12301
+ hasRationale: false,
12302
+ sourceKind: "manual",
12303
+ executionOutcome: "completed",
12304
+ expected: 0.72
12305
+ },
12306
+ {
12307
+ candidateType: "DECISION",
12308
+ hasDecision: true,
12309
+ hasRationale: true,
12310
+ sourceKind: "manual",
12311
+ executionOutcome: "completed",
12312
+ expected: 0.82
12313
+ },
12314
+ {
12315
+ candidateType: "DECISION",
12316
+ hasDecision: true,
12317
+ hasRationale: true,
12318
+ sourceKind: "phase_commit",
12319
+ executionOutcome: "completed",
12320
+ expected: 0.86
12321
+ },
12322
+ {
12323
+ candidateType: "DECISION",
12324
+ hasDecision: true,
12325
+ hasRationale: true,
12326
+ sourceKind: "phase_commit",
12327
+ executionOutcome: "partial",
12328
+ expected: 0.76
12329
+ },
12330
+ {
12331
+ candidateType: "DECISION",
12332
+ hasDecision: true,
12333
+ hasRationale: true,
12334
+ sourceKind: "phase_commit",
12335
+ executionOutcome: "blocked",
12336
+ expected: 0.76
12337
+ },
12338
+ {
12339
+ candidateType: "DECISION",
12340
+ hasDecision: true,
12341
+ hasRationale: true,
12342
+ sourceKind: "phase_commit",
12343
+ executionOutcome: "abandoned",
12344
+ expected: 0.76
12345
+ },
12346
+ {
12347
+ candidateType: "DECISION",
12348
+ hasDecision: true,
12349
+ hasRationale: false,
12350
+ sourceKind: "final_commit",
12351
+ executionOutcome: "completed",
12352
+ expected: 0.76
12353
+ }
12354
+ ]
12355
+ };
12356
+
12357
+ // ../project-intelligence-contracts/src/why-capture-confidence.ts
12358
+ var WHY_CAPTURE_CONFIDENCE_VERSION = why_capture_confidence_v1_default.version;
12359
+ var WHY_CAPTURE_CONFIDENCE_TEST_VECTORS = why_capture_confidence_v1_default.vectors;
12360
+
12288
12361
  // src/commands/decision-requests.ts
12289
12362
  var fs12 = __toESM(require("fs"));
12290
12363
  var path11 = __toESM(require("path"));
@@ -16659,7 +16732,12 @@ async function heartbeatHostedLeases(context, leaseIds) {
16659
16732
  }
16660
16733
  try {
16661
16734
  const data = await Promise.all(
16662
- leaseIds.map((leaseId) => client.updateCollaborationLease(leaseId, { action: "heartbeat" }))
16735
+ leaseIds.map(
16736
+ (leaseId) => client.updateCollaborationLease(leaseId, {
16737
+ ...context.actor,
16738
+ action: "heartbeat"
16739
+ })
16740
+ )
16663
16741
  );
16664
16742
  return { status: "ok", data };
16665
16743
  } catch (error) {
@@ -16675,6 +16753,7 @@ async function releaseHostedLeases(context, leaseIds, input) {
16675
16753
  const data = await Promise.all(
16676
16754
  leaseIds.map(
16677
16755
  (leaseId) => client.updateCollaborationLease(leaseId, {
16756
+ ...context.actor,
16678
16757
  action: "release",
16679
16758
  reason: input.reason
16680
16759
  })
@@ -23037,6 +23116,15 @@ function formatPolicyGateDecision(gateDecision) {
23037
23116
  }
23038
23117
 
23039
23118
  // src/commands/run.ts
23119
+ var HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS = 8e3;
23120
+ var HOSTED_PROJECT_INTELLIGENCE_ERROR_MAX_LENGTH = 500;
23121
+ function hostedProjectIntelligenceError(error) {
23122
+ if (error instanceof Error && error.name === "AbortError") {
23123
+ return `Timed out after ${HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS}ms`;
23124
+ }
23125
+ const message = error instanceof Error ? error.message : String(error);
23126
+ return message.trim().slice(0, HOSTED_PROJECT_INTELLIGENCE_ERROR_MAX_LENGTH) || "Unknown error";
23127
+ }
23040
23128
  var GUARD_MAX_BUFFER_BYTES = 16 * 1024 * 1024;
23041
23129
  var RAW_OUTPUT_PREVIEW_BYTES = 64e3;
23042
23130
  var ADVISOR_RECEIPT_WRITE_LIMIT = 6;
@@ -23708,16 +23796,37 @@ async function buildProjectIntelligenceRun(options) {
23708
23796
  skipMemoryHealth: options.skipMemoryHealth
23709
23797
  });
23710
23798
  let hostedProjectIntelligenceBrief;
23799
+ let hostedJudgment;
23711
23800
  try {
23712
- hostedProjectIntelligenceBrief = await createClient(3e4).createProjectIntelligenceBrief({
23801
+ hostedProjectIntelligenceBrief = await createClient(
23802
+ HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS
23803
+ ).createProjectIntelligenceBrief({
23713
23804
  ...options.task ? { task: options.task } : {},
23714
23805
  ...options.diffSummary ? { diffSummary: options.diffSummary } : {},
23715
23806
  ...changedFiles.length > 0 ? { changedFiles: changedFiles.slice(0, 120) } : {}
23716
23807
  });
23717
23808
  if (hostedProjectIntelligenceBrief.servedJudgmentId) {
23718
23809
  brief.servedJudgmentId = hostedProjectIntelligenceBrief.servedJudgmentId;
23810
+ hostedJudgment = {
23811
+ version: "project-intelligence.hosted-judgment-link.v1",
23812
+ status: "linked",
23813
+ timeoutMs: HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS,
23814
+ servedJudgmentId: hostedProjectIntelligenceBrief.servedJudgmentId
23815
+ };
23816
+ } else {
23817
+ hostedJudgment = {
23818
+ version: "project-intelligence.hosted-judgment-link.v1",
23819
+ status: "unlinked",
23820
+ timeoutMs: HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS
23821
+ };
23719
23822
  }
23720
- } catch {
23823
+ } catch (error) {
23824
+ hostedJudgment = {
23825
+ version: "project-intelligence.hosted-judgment-link.v1",
23826
+ status: "unavailable",
23827
+ timeoutMs: HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS,
23828
+ error: hostedProjectIntelligenceError(error)
23829
+ };
23721
23830
  }
23722
23831
  const guard = options.release && !options.skipGuard ? runGuard(options, changedFiles) : void 0;
23723
23832
  const packageReview = options.release || changedFiles.some((file) => file.startsWith("packages/cli/")) ? runPackageReview(options) : void 0;
@@ -23808,6 +23917,7 @@ async function buildProjectIntelligenceRun(options) {
23808
23917
  runEnvelope,
23809
23918
  release: Boolean(options.release),
23810
23919
  brief,
23920
+ hostedJudgment,
23811
23921
  ...guard ? { guard } : {},
23812
23922
  ...packageReview ? { packageReview } : {},
23813
23923
  policyGates,
@@ -23832,6 +23942,17 @@ async function projectIntelligenceRunCommand(options) {
23832
23942
  }
23833
23943
  console.log(`Release: ${result.release ? "yes" : "no"}`);
23834
23944
  console.log(`Run: ${result.runEnvelope.runId} (${result.runEnvelope.identitySource})`);
23945
+ if (result.hostedJudgment.status === "linked") {
23946
+ console.log(`Hosted judgment: linked (${result.hostedJudgment.servedJudgmentId})`);
23947
+ } else if (result.hostedJudgment.status === "unlinked") {
23948
+ console.log("Hosted judgment: unlinked (no served identity returned)");
23949
+ } else {
23950
+ console.log(
23951
+ import_chalk8.default.yellow(
23952
+ `Hosted judgment: unavailable (${result.hostedJudgment.error ?? "unknown error"})`
23953
+ )
23954
+ );
23955
+ }
23835
23956
  console.log("");
23836
23957
  console.log(import_chalk8.default.bold("Project Judgment"));
23837
23958
  for (const line of formatProjectJudgmentCard(result.judgmentCard)) {
@@ -1341,6 +1341,12 @@ path. Without either identity, receipt capture remains fail-closed and reports
1341
1341
  recommendation is only `acknowledged` by default: its `expectedBehaviorChange`,
1342
1342
  severity, required actions, and recommended checks never prove adaptation.
1343
1343
 
1344
+ The hosted lookup is best-effort and bounded to 8 seconds. `run --json` exposes
1345
+ `hostedJudgment.status` as `linked`, `unlinked`, or `unavailable`, including a
1346
+ bounded failure message when the hosted endpoint cannot be reached. Human
1347
+ output prints the same state in one line. A hosted failure never removes the
1348
+ local Judgment Card or turns network availability into implicit receipt proof.
1349
+
1344
1350
  To record `applied`, provide both explicit plan snapshots. Companion normalizes
1345
1351
  and bounds each snapshot to 4,000 characters, then compares stable hashes:
1346
1352
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snipara-companion",
3
- "version": "3.5.6",
3
+ "version": "3.5.8",
4
4
  "description": "Local-first CLI that asks your repo what breaks before an AI coding agent edits it.",
5
5
  "main": "dist/index.js",
6
6
  "bin": {