snipara-companion 3.5.6 → 3.5.7

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,21 @@
2
2
 
3
3
  Release notes for `snipara-companion`, newest first.
4
4
 
5
+ ## New In 3.5.7
6
+
7
+ - Bounds the best-effort hosted judgment lookup in `run` to 8 seconds instead
8
+ of silently waiting for up to 30 seconds.
9
+ - Exposes `hostedJudgment.status` as `linked`, `unlinked`, or `unavailable` in
10
+ JSON and prints one concise human-readable diagnostic without blocking the
11
+ local Judgment Card.
12
+ - Compatibility note: hosted context queries now treat an explicit
13
+ `max_tokens` value as immutable. Small conceptual or multi-hop budgets may
14
+ return less context than older servers that silently enlarged the request;
15
+ increase the requested budget when more context is intentional.
16
+ - Clarifies that references mode budgets the Answer Pack plus previews. Full
17
+ referenced chunks remain retrievable and their `token_count` is planning
18
+ metadata rather than initial response usage.
19
+
5
20
  ## New In 3.5.6
6
21
 
7
22
  - Adds a managed workflow Judgment V1 loop: `workflow judgment` serves and
package/dist/index.d.ts CHANGED
@@ -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
@@ -23037,6 +23037,15 @@ function formatPolicyGateDecision(gateDecision) {
23037
23037
  }
23038
23038
 
23039
23039
  // src/commands/run.ts
23040
+ var HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS = 8e3;
23041
+ var HOSTED_PROJECT_INTELLIGENCE_ERROR_MAX_LENGTH = 500;
23042
+ function hostedProjectIntelligenceError(error) {
23043
+ if (error instanceof Error && error.name === "AbortError") {
23044
+ return `Timed out after ${HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS}ms`;
23045
+ }
23046
+ const message = error instanceof Error ? error.message : String(error);
23047
+ return message.trim().slice(0, HOSTED_PROJECT_INTELLIGENCE_ERROR_MAX_LENGTH) || "Unknown error";
23048
+ }
23040
23049
  var GUARD_MAX_BUFFER_BYTES = 16 * 1024 * 1024;
23041
23050
  var RAW_OUTPUT_PREVIEW_BYTES = 64e3;
23042
23051
  var ADVISOR_RECEIPT_WRITE_LIMIT = 6;
@@ -23708,16 +23717,37 @@ async function buildProjectIntelligenceRun(options) {
23708
23717
  skipMemoryHealth: options.skipMemoryHealth
23709
23718
  });
23710
23719
  let hostedProjectIntelligenceBrief;
23720
+ let hostedJudgment;
23711
23721
  try {
23712
- hostedProjectIntelligenceBrief = await createClient(3e4).createProjectIntelligenceBrief({
23722
+ hostedProjectIntelligenceBrief = await createClient(
23723
+ HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS
23724
+ ).createProjectIntelligenceBrief({
23713
23725
  ...options.task ? { task: options.task } : {},
23714
23726
  ...options.diffSummary ? { diffSummary: options.diffSummary } : {},
23715
23727
  ...changedFiles.length > 0 ? { changedFiles: changedFiles.slice(0, 120) } : {}
23716
23728
  });
23717
23729
  if (hostedProjectIntelligenceBrief.servedJudgmentId) {
23718
23730
  brief.servedJudgmentId = hostedProjectIntelligenceBrief.servedJudgmentId;
23731
+ hostedJudgment = {
23732
+ version: "project-intelligence.hosted-judgment-link.v1",
23733
+ status: "linked",
23734
+ timeoutMs: HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS,
23735
+ servedJudgmentId: hostedProjectIntelligenceBrief.servedJudgmentId
23736
+ };
23737
+ } else {
23738
+ hostedJudgment = {
23739
+ version: "project-intelligence.hosted-judgment-link.v1",
23740
+ status: "unlinked",
23741
+ timeoutMs: HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS
23742
+ };
23719
23743
  }
23720
- } catch {
23744
+ } catch (error) {
23745
+ hostedJudgment = {
23746
+ version: "project-intelligence.hosted-judgment-link.v1",
23747
+ status: "unavailable",
23748
+ timeoutMs: HOSTED_PROJECT_INTELLIGENCE_BRIEF_TIMEOUT_MS,
23749
+ error: hostedProjectIntelligenceError(error)
23750
+ };
23721
23751
  }
23722
23752
  const guard = options.release && !options.skipGuard ? runGuard(options, changedFiles) : void 0;
23723
23753
  const packageReview = options.release || changedFiles.some((file) => file.startsWith("packages/cli/")) ? runPackageReview(options) : void 0;
@@ -23808,6 +23838,7 @@ async function buildProjectIntelligenceRun(options) {
23808
23838
  runEnvelope,
23809
23839
  release: Boolean(options.release),
23810
23840
  brief,
23841
+ hostedJudgment,
23811
23842
  ...guard ? { guard } : {},
23812
23843
  ...packageReview ? { packageReview } : {},
23813
23844
  policyGates,
@@ -23832,6 +23863,17 @@ async function projectIntelligenceRunCommand(options) {
23832
23863
  }
23833
23864
  console.log(`Release: ${result.release ? "yes" : "no"}`);
23834
23865
  console.log(`Run: ${result.runEnvelope.runId} (${result.runEnvelope.identitySource})`);
23866
+ if (result.hostedJudgment.status === "linked") {
23867
+ console.log(`Hosted judgment: linked (${result.hostedJudgment.servedJudgmentId})`);
23868
+ } else if (result.hostedJudgment.status === "unlinked") {
23869
+ console.log("Hosted judgment: unlinked (no served identity returned)");
23870
+ } else {
23871
+ console.log(
23872
+ import_chalk8.default.yellow(
23873
+ `Hosted judgment: unavailable (${result.hostedJudgment.error ?? "unknown error"})`
23874
+ )
23875
+ );
23876
+ }
23835
23877
  console.log("");
23836
23878
  console.log(import_chalk8.default.bold("Project Judgment"));
23837
23879
  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.7",
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": {